Answers for "remove enter before 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
0

jquery disable enter key submit

$(document).on('keyup keypress', 'input', function(e) {
  if(e.which == 13) {
    e.preventDefault();
    return false;
  }
});
Posted by: Guest on April-30-2020

Browse Popular Code Answers by Language