Categories:

Home / Free JavaScripts / Forms / Here

Cut & Paste Auto tab (form field) script

Credit: JavaScript Kit

Description: This script "auto tabs" a form field (and jumps to another field) once the length of the field's value has exceeded a certain length. It works in conjunction with the "maxlength" attribute of HTML, triggered whenever the user's input reaches the maxlength's value.

Make certain types of form fields more intuitive and convenient to fill out with this script. 

Example:

Enter your 10-digit phone number:

Directions: Simply insert the below in the <body> section of your page:

As shown in the sample form, the key to adding auto tabbling to a form field is through the code in red: 

<input type="text" name="first" size=4 onKeyup="autotab(this, document.sampleform.second)" maxlength=3>

Change "document.sampleform.second" to reference the field to auto tab to, and "maxlength" to specify the source field's character limit.


JavaScript Tools:
Site Info


CopyRight (c) 2018 JavaScript Kit. NO PART may be reproduced without author's permission. Contact Info