Sample Code that I'm using:
e.keyCode == 13 if (e.which==13) { e.preventDefault(); }
Is any idea apart from this?
Sample Code that I'm using:
e.keyCode == 13 if (e.which==13) { e.preventDefault(); }
Is any idea apart from this?
try this
var variablename= (e.keyCode ? e.keyCode : e.which);
if(code == 13) { //keycode of Enter key
alert('enter key pressed');
}
if you are using jquery
$('input[type=text]').on('keyup', function(e) {
if (e.which == 13) {
e.preventDefault();
}
});