I want to get information from a previous form that was entered in a textBox. I am currently trying something like this:
var accNumber = $('#index.html').RegisterForm.cardNumberRegField.val();
and I have also tried
var tfscNum = document.RegisterForm.cardNumberRegField.value;
I know this is wrong. The HTML page I want to get the information from is index.html
, and the form id is RegisterForm
. The ID of the textBox in that form is cardNumberRegField
EDIT
this is the html code i am using for the textBox and the button on the index.html page
<form id="RegisterForm" method="post" data-ajax="false" id="registerCardForm" action="register.html">
<input type="text" id="cardNumberRegField" type="tel" name="cardNumber" class="required number register" minlength="16" maxlength="16"/>
<input name="Submit" type="submit" class="button" value="Register"/>
</form>
Does anybody know the correct way to do this?