Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1612 How do I position the cursor on the first field of the first form in the first frame when the frameset loads?

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>

Feedback on 'Q1612 How do I position the cursor on the first field of the first form in the first frame when the frameset loads?'

©2018 Martin Webb