Code:
<form action="/initial.html" method="post" id="signin">
<input type="text" id="name" name="name" placeholder="Enter your fullname" />
<input type="text" id="handle" name="handle" placeholder="Enter your Handle" />
<input type="hidden" id="rank" name="rank" placeholder="CommanderI" />
<input type="hidden" id="money" name="money" placeholder="25,000EC" />
<input type="submit">
<script type="text/javascript">
const form = document.getElementById('signin');
form.addEventListener('submit', (event) => {
// handle the form data
const name = form.elements['name'];
const handle = form.elements['handle'];
const rank = form.elements['rank'];
const money = form.elements['money'];
// getting the element's value
let name = name.value;
let handle = handle.value;
let rank = rank.value;
let money = money.value;
});
</script>
I have this code, which is in a child iframe, I am not even sure if it is correct? Some of it is from a tutorial I found on the www. Anyway what I want to do is take these variables and post them to index.html and make them into a session anyone care to comment are welcome.