开发者

Jquery and jQuery-Validation-Engine

开发者 https://www.devze.com 2023-04-05 13:42 出处:网络
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:

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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号