1window.onkeypress = function(e) {
2 if (e.which == 13) {
3 e.preventDefault();
4 var nextInput = inputs.get(inputs.index(document.activeElement) + 1);
5 if (nextInput) {
6 nextInput.focus();
7 }
8 }
9};
1window.onkeypress = function(e) {
2 if (e.which == 13) {
3 e.preventDefault();
4 var inputs = document.getElementsByClassName('input');
5 for (var i = 0; i < inputs.length; i++) {
6 if (document.activeElement.id == inputs[i].id && i+1 < inputs.length ) {
7 inputs[i+1].focus();
8 break;
9 }
10 }
1var inputs = $(':input').keypress(function(e){
2 if (e.which == 13) {
3 e.preventDefault();
4 var nextInput = inputs.get(inputs.index(this) + 1);
5 if (nextInput) {
6 nextInput.focus();
7 }
8 }
9});