js preventdefault
function(event) {
event.preventDefault();
}
js preventdefault
function(event) {
event.preventDefault();
}
js opposite of preventdefault
event.preventDefault(); //or event.returnValue = false;
//and its opposite(standard) :
event.returnValue = true;
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
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us