jQuery If myform.valid() is true then fire another jQuery function?

后端 未结 3 771
予麋鹿
予麋鹿 2021-02-09 16:40

I have a jQuery function that i would like to execute only if the form validation is true
I have the validation and other jQuery working fine.
the problem is now b

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-09 17:35

    You have to use .validate().form()

    if (!$("#myform").validate().form()) {
        return false; //doesn't validate
    }else
    {
        //form is validated do your work
    }
    

提交回复
热议问题