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;}" />
write return false;
and check it
Other option would be using onkeypress
<input type="text" id="first_page" onPaste="" onkeypress="if (event.keyCode == 13) {alert('enter'); return false;}" />