Created
June 15, 2013 17:14
-
-
Save keithcollins/5788794 to your computer and use it in GitHub Desktop.
First, we take the ID and action of the form being called.
Next, we post the serialized form data to the handler specified in the form's action attribute.
On success, the handler should output a message to indicate all is well, or an error indicating otherwise. Remember that div at the bottom of the registration form? This is where the returned …
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
$('.ajaxForm').on('submit', function(e) { | |
var formId = $(this).attr('id'), | |
doAction = $(this).attr('action'); | |
$.post(doAction, $(this).serialize(), | |
function(data) { | |
$('#'+formId+'_result').html(data); | |
}); | |
e.preventDefault(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment