Created
March 21, 2017 12:58
-
-
Save slavapas/7ba4401b08c026426a71562e924bfd60 to your computer and use it in GitHub Desktop.
form submit ajax no reload
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#reg-form').submit(function(e){ | |
e.preventDefault(); // Prevent Default Submission | |
$('form :submit').prop('disabled', true); // disable submit button | |
$.ajax({ | |
// ajax source | |
}) | |
.done(function(data){ | |
$('form :submit').prop('disabled', false); // enable submit button | |
}) | |
.fail(function(){ | |
alert('Ajax Submit Failed ...'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment