Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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

irt.org | Knowledge Base | JavaScript | Form | Q1612 [ previous next ]

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

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?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.