Pure JS Library For Auto Tab Text Fields

Category: Form , Javascript | January 2, 2015
Views Total:813 views
Official Page:Go to website
Last Update:January 2, 2015


Pure JS Library For Auto Tab Text Fields


A lightweight standalone JavaScript library that provides auto tab functionality on text fields (inputs and textareas) in a form. The cursor will automatically jump to next text field when the current one reaches a specified max length.

How to use it:

Load the autoTab.js JS library at the end of the document.

<script src="src/autoTab.js"></script>

Specify the auto tab step and max length for each text fields using data-* attributes.

<input type="text" data-tab="0" data-length="5">
<textarea data-tab="1" data-length="140"></textarea>

Enable the auto tab functionality.

var autoTab;
(function() {
  autoTab = new autoTab();				

Available options.

var autoTab;
(function() {
  autoTab = new autoTab({
    autoFocus: false, 
    addStyle: false,
    onComplete: function() {}

You Might Be Interested In:

One thought on “Pure JS Library For Auto Tab Text Fields

Leave a Reply