Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onSuccess did not work #554

Closed
lindakun opened this issue Nov 30, 2012 · 2 comments
Closed

onSuccess did not work #554

lindakun opened this issue Nov 30, 2012 · 2 comments

Comments

@lindakun
Copy link

$(function(){
$("#loginform").validationEngine({
onSuccess:formSuccess
});
});

var formSuccess = function(form, status){
alert("1111!");
};
// jquery-1.8.2.min.js
//jQuery.validationEngine v2.6.1
hi,i try this code in my project, but it did not work, can't show the alert message "1111", could you help me?thanx!

@BurgerTech
Copy link

Same problem with me. The demoOnForm.html does not work for me either.

Tried Chrome and Firefox, still no luck.

Any help would be greatly appreciated. Thanks.

@mar4eva
Copy link

mar4eva commented Dec 2, 2012

    $(document).ready(function(){
        $("form#loginform").validationEngine('attach',{
            onValidationComplete: function(form, status){ // when validate is on and the form scan is completed
                if (status == true) { // equiv to success everythings is OK
                                             // we disable the default from action to make our own action like alert or other function
                    $("form#loginform").bind('submit', function(e) {
                              e.preventDefault();
                    });
                                 // uour function or your action 
                            alert("1111!");
                }else{
                    $("form#loginform").bind('submit', function(e) {
                        e.preventDefault();
                    });
                                            alert("error!") ; // auto popup error will be show'n
                }
            }
            //,binded:true
            ,promptPosition : "topLeft"
            ,scroll: true
            ,autoPositionUpdate : true
            ,focusFirstField : true
            ,validationEventTrigger:""
        });
    });

goood luck !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants