Answers for "don;t make enter key submit the form"

6

html disable enter submit

//per form disabling
<form ... onkeydown="return event.key != 'Enter';">
 
  
//or with jquery  
<script>
 $(document).on("keydown", "form", function(event) { 
    return event.key != "Enter";
});
 </script>
Posted by: Guest on August-26-2020
1

how to stop form from submitting on enter

<form ... onkeydown="return event.key != 'Enter';">
Posted by: Guest on November-26-2020
0

do nothing on enter on input field

<input type="text" name="mytext" onkeypress="return event.keyCode!=13">
Posted by: Guest on October-15-2020

Code answers related to "don;t make enter key submit the form"

Browse Popular Code Answers by Language