I would like to change the default behavior on my elements:
$('form input').keypress(function (e) {
if (e.which == 13) { // ENTER key
e.setTempDefault(9); // TAB key
// e.preventDefault();
}
});
Obviously, setTempDefault does not exist.
All I can find is e.preventDefault();
$('form input').keypress(function (e) {
if (e.which === 13) {
e.preventDefault();
$(':input').eq( $(this).index(':input') + 1 ).focus();
}
});
FIDDLE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With