jquery preventdefault
$("a").click(function(event){
event.preventDefault();
});
jquery preventdefault
$("a").click(function(event){
event.preventDefault();
});
jquery prevent form submit
//option A
$("form").submit(function(e){
e.preventDefault();
});
prevent form submission using jquery
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type='text/javascript'>
$(document).ready(function() {
//option A
$("form").submit(function(e){
alert('submit intercepted');
e.preventDefault(e);
});
});
</script>
</head>
<body>
<form action="page_url" method="GET">
Search <input type='text' name='q' />
<input type='submit'/>
</form>
</body>
</html>
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