Revision: 45696
Updated Code
at May 5, 2011 12:11 by genik
Updated Code
$('input[type=text]').keydown(function(e){ //get the next index of text input element var next_idx = $('input[type=text]').index(this) + 1; //get number of text input element in a html document var tot_idx = $('body').find('input[type=text]').length; //enter button in ASCII code if(e.keyCode == 13){ if(tot_idx == next_idx) //go to the first text element if focused in the last text input element $('input[type=text]:eq(0)').focus(); else //go to the next text input element $('input[type=text]:eq(' + next_idx + ')').focus(); } });
Revision: 45695
Updated Code
at May 5, 2011 12:09 by genik
Updated Code
$('input[type=text]').keydown(function(e){ //get the next index of text input element var next_idx = $('input[type=text]').index(this) + 1; //get number of text input element in a html document var tot_idx = $('body').find('input[type=text]').length; //enter button in ASCII code if(e.keyCode == 13){ if(tot_idx == next_idx) //go to the first text element if focused in the last text element $('input[type=text]:eq(0)').focus(); else //go to the next text input element $('input[type=text]:eq(' + next_idx + ')').focus(); } });
Revision: 45694
Updated Code
at May 5, 2011 12:06 by genik
Updated Code
$('input[type=text]').keydown(function(e){ //get the next index of text input element var next_idx = $('input[type=text]').index(this) + 1; //get number of text input element in a html document var max_idx = $('body').find('input[type=text]').length; //enter button in ASCII code if(e.keyCode == 13){ if(max_idx == next_idx) //go to the first text element if focused in the last text element $('input[type=text]:eq(0)').focus(); else //go to the next text input element $('input[type=text]:eq(' + next_idx + ')').focus(); } });
Revision: 45693
Updated Code
at May 5, 2011 12:04 by genik
Updated Code
$('input[type=text]').keydown(function(e){ //get the next index of text element var next_idx = $('input[type=text]').index(this) + 1; //get total number text element in a document var max_idx = $('body').find('input[type=text]').length; //enter button in ASCII code if(e.keyCode == 13){ if(max_idx == next_idx) //go to the first text element if focused in the last text element $('input[type=text]:eq(0)').focus(); else //go to the next text input element $('input[type=text]:eq(' + next_idx + ')').focus(); } });
Revision: 45692
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at May 5, 2011 11:56 by genik
Initial Code
$('input[type=text]').keydown(function(e){ //get the current index of text element var next_idx = $('input[type=text]').index(this) + 1; //get total number text element in a document var max_idx = $('body').find('input[type=text]').length; //enter button in ASCII code if(e.keyCode == 13){ if(max_idx == next_idx) //go to the first text element if focused in the last text element $('input[type=text]:eq(0)').focus(); else //go to the next text input element $('input[type=text]:eq(' + next_idx + ')').focus(); } });
Initial URL
Initial Description
Set focus to all next text input in a html document when press enter button on your keyboard. If focused at the last text input element, it will be back to the first text input element.
Initial Title
Set Focus To Next Text Input On Press Enter Button
Initial Tags
jquery
Initial Language
jQuery