HTML Text Input: Avoid submit when enter is pressed
Using jQuery: <script> $(‘#first_page’).keypress(function(e) { if (e.keyCode == ’13’) { e.preventDefault(); //your code here } }); </script> using javascript <input type=”text” id=”first_page” onPaste=”” onkeydown=”if (event.keyCode == 13) { alert(‘enter’);return false;}” />