1

我正在使用在GitHub 上找到的 jQuery-Validation-Engine ,它运行良好,但是在提交表单以创建操作后,我无法管理一件事。到目前为止的代码:

jQuery(document).ready(function(){
            jQuery("#contact-form").validationEngine({
ajaxFormValidation: true,
             onSuccess: function(){
                 alert(1);
             }
            });
        });

这是工作(数据写入数据库),但没有警报。我也尝试过 onAjaxFormComplete 但又没有。有人有这个插件的经验吗?

4

1 回答 1

0

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

于 2012-03-15T11:09:50.513 回答