Answers for "prevent input from submitting form"

1

jquery avoid enter submit

$(document).ready(function() {
  $(window).keydown(function(event){
    if(event.keyCode == 13) {
      event.preventDefault();
      return false;
    }
  });
});
Posted by: Guest on June-12-2020
0

prevent button from submitting form

function myFunc(e){
       e.preventDefault();
}
Posted by: Guest on June-24-2020
2

prevent button form submit

<button type="button">Button</button>
Posted by: Guest on July-09-2020

Code answers related to "prevent input from submitting form"

Browse Popular Code Answers by Language