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

Q123 Upon loading a page with a form, is it possible to set the focus to a form object, e.g. "User Name" Textbox?

You are here: irt.org | FAQ | JavaScript | Form | 2 | Q123 [ previous next ]

Yes it is possible, in several ways, but the most effective is:

<form name="myFormName">
<input type="text" name="myTextField">
</form>

<script language="JavaScript"><!--
document.myFormName.myTextField.focus();
//--></script>

Feedback on 'Q123 Upon loading a page with a form, is it possible to set the focus to a form object, e.g. "User Name" Textbox?'

©2018 Martin Webb