Hello Reader! If you want your html form that block the pressing action of enter button and accept only submit button then you can see how its working in the example below :-
$("FormSubmit").bind("keypress", function (e) {
if (e.keyCode == 13) {
$("#btnSearch").attr('value');
return false;
}
});
The logic behind this is to block the key having ASCII key code = 13.
On call the form with 'Onsubmit' to this function, it will always block the key with ASCII 13.
0 Comment(s)