You are here: irt.org | FAQ | JavaScript | Form | 4 | Q913 [ previous next ]
First the frameset:
<frameset rows="50%,*"> <frame src="page1.htm" name="frameNameA"> <frame src="page2.htm" name="frameNameB"> </frameset>
Then in page1.htm:
<form name="myFormName"> <input type="text" name="myFieldName"> </form>
Then in page2.htm:
<form> <select onChange="parent.frameNameA.document.myFormName.myFieldName.value = this.options[this.selectedIndex].value"> <option value="hello world">option 0 <option value="Hello world">option 1 <option value="Hello World">option 2 <option value="hELLO wORLD">option 3 <option value="HELLO WORLD">option 4 </select> </form>
To get this to work for a form field on the same page use:
<form name="myFormName"> <input type="text" name="myFieldName"> <br> <select onChange="document.myFormName.myFieldName.value = this.options[this.selectedIndex].value"> <option value="hello world">option 0 <option value="Hello world">option 1 <option value="Hello World">option 2 <option value="hELLO wORLD">option 3 <option value="HELLO WORLD">option 4 </select> </form>