Pure JS Library For Auto Tab Text Fields

Category: Form , Javascript | January 2, 2015
Author: djhvscf
Views Total: 2,514
Official Page: Go to website
Last Update: January 2, 2015
License: MIT

Preview:

Pure JS Library For Auto Tab Text Fields

Description:

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