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

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

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

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

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


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.