Try this.
$('#myform').submit( function(e) {
e.preventDefault();
returnfalse;
});
Remember to put this code inside a ready function.
Try to submit your for using ajax request :
$('#myform').on('submit', function(){
e.preventDefault();
$.get('url', { $(this).serialize() }, function(server_response){
})
})
Or also :
$('#myform').on('submit', function(){
e.preventDefault();
$.ajax({
method: "GET",
url: "url.php",
data: $(this).serialize()
})
.done(function( msg ) {
alert( "Seuccess" );
});
})
Hope this helps.
Post a Comment for "Prevent Page Reload When Submit"