document.onkeypress = function (event) { e = event || window.event; if (e.keyCode == 13) { e.preventDefault(); } }