Of course I did. This is my code for that.
function beforeCall(form, options){
if (window.console)
// console.log("Right before the AJAX form validation call");
return true;
}
// Called once the server replies to the ajax form validation request
// function ajaxValidationCallback(status, form, errors, options){
function ajaxValidationCallback(form, status){
if (window.console)
console.log(status);
if (status === true) {
alert("the form is valid!");
// uncomment these lines to submit the form to form.action
form.validationEngine('detach');
//form.submit();
}
}
jQuery('#appForm').validationEngine('attach', {
validationEventTrigger:"focusout",
relative:true,
ajaxFormValidation:true,
// onAjaxFormComplete: ajaxValidationCallback,
onValidationComplete: ajaxValidationCallback,
onBeforeAjaxFormValidation: beforeCall
});
It doesn't even scroll up anymore to the first error, so it's possible that there's something wrong in my code, but I don't see how that would break the json data. Especially if it looks like it's being sent fine. Is it an issue with jQuery 1.7.1?
ETA: Well, it wasn't an issue with the plugin. My bad. I finally loaded up Firefox to check it in Firebug and saw the php response.
Sorry for wasting your time!
ETA2: In case anyone else has this issue (which is probably going to be me again lol), _validateFormWithAjax is expecting a json response from the server. So to actually use _validateFormWithAjax via onAjaxFormComplete or onValidationComplete, you're going to have to write a PHP file for AJAX form validation (see demos/phpajax/ajaxValidateSubmit.php), and, when that is successful, do whatever processing you want your form data to do.
In my case, the processing is converting all the data to a human readable text output for an email body, which will be done via a jQuery ajax call after _validateFormWithAjax returns true.
Hope that helps someone else! The docs are so not clear about form submit.