Feedback on: irt.org FAQ Knowledge Base Q1785
Worth:
Length:
Technical:
Comments:
This works only on IE not Firefox
Worth:
Not worth reading
Length:
Too short
Technical:
Not technical enough
Comments:
To make this work with the different eventmodels in IE and Firefox/others something like this is needed:
function stopEnter(e) {
e = e || window.event;
var code = e.keyCode || e.which;
if (code == 13) {
// Possibly call some other function here,
// like an AJAX search instead of submitting the form
return false;
}
return true;
}
<input type="text" onkeypress="return stopEnter(event);">