I used jquery validation (http://bassistance.de/jquery-plugins/jquery-plugin-validation/) for form validation. The followings are some fragments of my code:
HTML:
<
Instead of:
// Submit the form by Ajax
$(document).ready(function() {
$('.formID').ajaxForm({
success: function(returnData) {
$('#content').html(returnData);
}
});
});
Use the submitHandler
option of the Validate plugin, like this:
$("#formID").validate({
//all your other options
submitHandler: function(form) {
$(form).ajaxForm({
success: function(returnData) {
$('#content').html(returnData);
}
});
}
});