I have a form with " required" in the <input> lines. The problem is that if I terminate a field value with Enter I get an annoying "Please fill out this field" for the next field, because it obviously wants to submit the form on Enter. Ideally I'd like to map keycode 13 to 9, since the behavior I want occurs if you enter Tab after a field value, i.e., just move to the next field.
I've tried
$("form#checkout_form").keypress(function(e) { if(e.keyCode == 13) { e.keyCode = 9; } }); but that doesn't work. Does anyone have any other ideas?
Thanks
e.preventDeault()can help you here.