0

I know how to set it to auto jump to the next field in the form after a certain number of characters are entered. But that's not what I need. I need this: If number 2,3,4,5,6,7,8, or 9 is entered, I do want auto jump to the next field. However, if the number 1 is entered, I do not want to jump to the next field. If the number 1 is entered I want to be able to add a second digit to that field, and then it should auto jump to the next field.

In other words, if I enter a 2, autojump takes me to the next field. It would continue to work this way for any numbers 2-9. But if the number 1 is entered, I would like to add a second digit, making it a 10 or 11 or 12, etc. (only up to 19), and then it should auto jump to the next field.

2
Contributors
1
Reply
8
Views
4 Years
Discussion Span
Last Post by imBaCodes
1

Try this:

 var inputvalUE = $("Your_Input").val()
    if (inputvalUE <= 2 && inputvalUE >= 9){ 
        $(this).nextAll('input').first().focus();
    }else if (inputvalUE <= 11 && inputvalUE >= 19 ){
         $(this).nextAll('input').first().focus();
    }else{
        //do nothing..
    }

Hope this will help you or give you an idea.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.