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

Q774 How do I maintain a tab order if form fields in browsers that do not support tabindex?

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

Q774 How do I maintain a tab order if form fields in browsers that do not support tabindex?

If the data has been changed, then when the enter key is pressed the form fields onChange event handler is tripped. You can use this to set the focus on another form field:

<FORM NAME="myForm">
<INPUT TYPE="TEXT" NAME="text1" onChange="this.form.text2.focus()">
<INPUT TYPE="TEXT" NAME="text2" onChange="this.form.text3.focus()">
<INPUT TYPE="TEXT" NAME="text3">
</FORM>

Alternatively, you can use the onBlur event handler to trap something similar:

<FORM NAME="myForm">
<INPUT TYPE="TEXT" NAME="text1" onBlur"this.form.text2.focus()">
<INPUT TYPE="TEXT" NAME="text2" onBlur="this.form.text3.focus()">
<INPUT TYPE="TEXT" NAME="text3">
</FORM>

However, not all of the older browsers/operating systems support the onBlur event handler.


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.