You are here: irt.org | FAQ | JavaScript | Form | Q1612 [ previous next ]
Using a named frame and a named form and a named form field:
<frameset rows="50%,*" onLoad="document.myFrame.myForm.myField.focus()"> <frame name="myFrame" src="test.htm"> <frame src="test.htm"> </frameset>
Where test.htm contains:
<form name="myForm"> <input type="text" name="myField"> </form>
When the frame, form and field names are not known then:
<frameset rows="50%,*" onLoad="document.frames[0].forms[0].elements[0].focus()"> <frame src="test.htm"> <frame src="test.htm"> </frameset>
Where test.htm contains:
<form> <input type="text"> </form>