Jquery Validation Plugin, dynamic form validation

前端 未结 2 635
萌比男神i
萌比男神i 2021-01-21 12:08

I\'m using the Jquery Validation Plugin to forms loaded via Ajax (dynamic forms). I know that as of Jquery 1.4, live events on submit is now possible. Now the problem is I want

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-21 12:41

    Somehow this seems to work:

    $('.dynamicForm').live('mouseover',function(){
        $(this).validate({
            submitHandler:function(form){
                if(confirm("Are you sure?")){
                    form.submit();
                }
            }
        });
    });
    

提交回复
热议问题