Answers for "e.preventdefault() not working"

17

js preventdefault

function(event) {
  event.preventDefault();
}
Posted by: Guest on December-10-2020
0

preventdefault not working react

//think if you are adding your submit handler function in the submit button
//or into the form itself
const handler = () => {
  e.preventDefault();
}
<form onSubmit={handler}> //good
<button type="submit" onSubmit={handler}> // bad
Posted by: Guest on October-15-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language