Created
November 28, 2013 13:53
-
-
Save thilak-rao/7692169 to your computer and use it in GitHub Desktop.
Once the maximum number of characters has been reached within a defined text fields, the focus is automatically set to the defined target of the element. This is the simplest method. Other jQuery plugins exists, but this is easier.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $("input[type=text]").on('input',function () { | |
| if($(this).val().length == $(this).attr('maxlength')) { | |
| $(this).next("input").focus(); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment