I have a simple form that accepts input into a text box, passes it to another html page using method="get" and displays the input on the screen to be verified before actual submission.
I have no probem getting the information to pass to the 2nd page, but I am not sure how I can get that information to actually be submitted.
Here is my code:
Page1 - this sends the info in the textbox to Page2.
Code:
<html>
<head>
<title></title>
</head>
<body>
<form name="myform" method="get" action="page2.html">
Enter Name: <input type="text" name="input1">
<input type="submit">
</form>
</body>
</html>
Page2 - this receives the input reading it from the address bar and displays it on the page.
Code:
<html>
<head>
<title></title>
<script LANGUAGE="JavaScript">
function decodeSearchString() {
var nameValue = new Array();
var searchStr = unescape(location.search.substring(1));
if (searchStr) {
var formElement = searchStr.split("&");
var tmpArray = new Array();
for (k = 0; k < formElement.length; k++) {
tmpArray = formElement[k].split("=");
nameValue[tmpArray[0]] = tmpArray[1];
}
}
return nameValue
}
var srchData = decodeSearchString();
</SCRIPT>
</head>
<body>
<form name="myform" method="post" action="WHATEVER">
<input type="hidden" name="subject" value="My Form">
<input type="hidden" name="next_url" value="WHATEVER">
<script>document.write(srchData.input1.replace(/\+/g, ' '));</script>
<input type="submit">
</form>
</body>
</html>
I cannot get the value of input1 to be submitted. I only receive the subject = My Form.
Any suggestions?