jQuery UI Dialog with Form Validation Plugin

前端 未结 5 996
轻奢々
轻奢々 2021-02-09 22:41

I am currently using the bassistance validation plugin for my forms. And I am using a pop-up modal dialog box to house a form that needs to be validated, but for some reason it

5条回答
  •  清酒与你
    2021-02-09 23:19

    The validators validate function simply sets up validation, it does not trigger it. The triggering is done automatically when the form is submitted or when a field gets written in. Try adding your validation code to the open event:

    $("#addEventDialog").dialog("open");
                $("#addEventDialog").dialog({
                    open: function() {
                        $("#interestForm").validate({
                            ...
                        });
                    }, ...
    

提交回复
热议问题