Last active
March 22, 2018 09:18
-
-
Save inog/8862158e400e04d4c3d5c1d4107001c7 to your computer and use it in GitHub Desktop.
focus next input when maxlength is reached
This file contains 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
var a = document.getElementById('form:tabView:kan1'), | |
b = document.getElementById('form:tabView:kan2'), | |
c = document.getElementById('form:tabView:jahr'); | |
a.onkeyup = function() { | |
if (this.value.length === parseInt(this.attributes["maxlength"].value)) { | |
b.focus(); | |
} | |
} | |
b.onkeyup = function() { | |
if (this.value.length === parseInt(this.attributes["maxlength"].value)) { | |
c.focus(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment