You are here: irt.org | FAQ | JavaScript | Form | 10.3 | Q480 [ previous next ]
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>