Auto Tab | JavaScriptSource

Auto Tab

JavaScriptSource Staff Apr 21, 2000

General

Automatically sets focus to the next form element when the current form element's maxlength has been reached. The user, then, does not have to manually click in or tab to the next field. Very easy to change for different size fields. Perfectly suited for constant-length strings such as a phone number or social security numbers.


Phone Number :
1 - ( ) - -

Social Security Number :
- -

Notes

  • Created by: Cyanide_7
  • Posted: April 21, 2000

Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: autoTab.js


Head

Paste this code into the HEAD section of your HTML document.


Body

Paste this code into the BODY section of your HTML document


Leave a Response

(10 comments)

Well, that's just not the way not was created. It could always be adapted to do that.

Lee Oct 31, 2008

In order to better help you, you'll need to post your question [a href="http://www.webdeveloper.com/forum/forumdisplay.php?f=3"]over on the forums[/a].

Lee Jun 26, 2008

In order to better help you, you'll need to post your question [a href="http://www.webdeveloper.com/forum/forumdisplay.php?f=3"]over on the forums[/a].

Lee Jun 26, 2008

use:[br /][br /]input.form[(getIndex(input)+1) % input.form.length].select();[br /][br /]instead of[br /][br /]input.form[(getIndex(input)+1) % input.form.length].focus();

Bob Vila Jun 3, 2008

when moving to the next field, it does not set the focus to highlight the field, so that anything keyed adds to what is there instead of replacing it. And if that field is already full, you just jump to the next field.[br /][br /]It's a shame because the idea is really worthwhile

Reg May 16, 2008