events - jQuery how to make Enter (Return) act as Tab key through input text fields but in the end trigger the submit button -
i've blocked enter (return) key, actually, transformed in tab key. when pressed inside input text fields acts tab key. good, need trigger submit button when pressed in last field, below code enter key mutation:
$('input').keydown(function(event) { if(event.which == 13) { event.preventdefault(); $(this).nextall('input:first').focus(); } }); and form code sequence of input type="text" , button type="submit" @ end [edited] code one, taken jquery: enter tab trigger in specific parts. don't know why working yesterday today not working:
$(':text').keydown(function(e) { if(e.keycode == 13 && $(this).attr('type') != 'submit') { e.preventdefault(); $(this).nextall('input:first').focus(); } });
if give last input class of last modify code like
$('input').keydown(function(event) { if(!$(this).hasclass("last")){ if(event.which == 13) { event.preventdefault(); $(this).nextall('input:first').focus(); } } });
Comments
Post a Comment