|
Q480 How do I pass the value of a text field when the submit button is pressed onto the next page?
irt.org | Knowledge Base | JavaScript | Form 10.3 | Q480 [ previous next ]
Q480 How do I pass the value of a text field when the submit button is pressed onto the next page?
Use the following on the source page:
<form onSubmit="return false">
<input type="text" name="textName">
<input type="button" value="Go" onClick="window.location.href = 'nextpage.html?' + this.form.textName.value">
</form>
|
And the following on the nextpage.html:
<form name="formName"><input type="text" name="textName"></form>
<script language="JavaScript"><!--
document.formName.textName.value = location.search.substring(1);
//--></script>
|
Or, alternatively:
<script language="JavaScript"><!--
document.write("<form><input type='text' ");
document.write("value='"+location.search.substring(1)+"'></form>");
//--></script>
|
Feedback on 'Q480 How do I pass the value of a text field when the submit button is pressed onto the next page?'
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.