フィールド間を自動でタブ移動してくれる入力補助 - Autotab
フィールド間を自動でタブ移動してくれる入力補助JSライブラリ「Autotab」の紹介です。
電話番号入力欄や、郵便番号入力欄で、フィールドが複数に分かれている場合に、
自動で次のフィールドに移ります。
また、数字やローマ字、大文字、小文字等の入力指定もできます。
AutotabはjQueryのプラグインのため、実装にはjquery.jsが必要です。
JavaScript ▼(autotabメソッドで初期化)
HTML ▼
<form>
<div><strong>Phone Number:</strong></div>
<input type="text" name="area_code" id="area_code" maxlength="3" size="3" /> -
<input type="text" name="number1" id="number1" maxlength="3" size="3" /> -
<input type="text" name="number2" id="number2" maxlength="4" size="5" />
</form>
