Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
39
rated 0 times [  41] [ 2]  / answers: 1 / hits: 34872  / 11 Years ago, mon, july 8, 2013, 12:00:00

I am making a Web application that validates passkeys and displays some values there are four passkeys for a file to be entered Validate it, I am entering the passkeys just like we enter the Credit Card Number in the Payment gateway. In my present application I have enter one Passkey then have to press Tab or using the Mouse I have to select the Next Textbox to enter next Passkey, How do I Make the mouse Cursor to Jump automatically from one Textbox to Another Textbox after its maximum value filled like in Payment gateways


More From » html

 Answers
23

You can do pure javascript like this:



<script type=text/javascript>
function ValidatePassKey(tb) {
if (tb.TextLength >= 4)
document.getElementById(tb.id + 1).focus();
}
}
</script>

<input id=1 type=text onchange=ValidatePassKey(this) maxlength=4>
<input id=2 type=text onchange=ValidatePassKey(this) maxlength=4>
<input id=3 type=text onchange=ValidatePassKey(this) maxlength=4>
<input id=4 type=text maxlength=4>

[#77137] Saturday, July 6, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
neo

Total Points: 117
Total Questions: 100
Total Answers: 95

Location: Albania
Member since Fri, Jan 28, 2022
2 Years ago
;