问题
I am using jQuery-Validation-Engine found at GitHub and it is working good, but I can't manage one thing ,after form is submitted to create action. Code so far:
jQuery(document).ready(function(){
jQuery("#contact-form").validationEngine({
ajaxFormValidation: true,
onSuccess: function(){
alert(1);
}
});
});
This is working(data is written into db) but there is no alert. I also tried with onAjaxFormComplete but again nothing. Does someone have experience with this plugin?
回答1:
Could you try this:
jQuery(document).ready(function(){
jQuery("#contact-form").validationEngine('attach', {
ajaxFormValidation: true,
onAjaxFormComplete: function(form, status){
alert("The form status is: " +status);
}
});
});
Also remember than on the SUBMIT page(where you send it to the database), you need to gerenate a repsonse back -if the form was submitted or not (true/false).
See: https://github.com/posabsolute/jQuery-Validation-Engine/blob/master/demos/phpajax/ajaxValidateSubmit.php
来源:https://stackoverflow.com/questions/7428229/jquery-and-jquery-validation-engine