jQuery using .on and .validate must submit form twice to validate

前端 未结 5 1406
走了就别回头了
走了就别回头了 2020-12-12 04:09

I am loading a form via ajax and usind the new .on() to load the jQuery validate plugin is not loaded before I press the submit a second time. I understand why I think. The

5条回答
  •  不思量自难忘°
    2020-12-12 04:47

    I think you have a mispelling..

    Working example: http://jsfiddle.net/mFeww/4/

         $(document).ready(function(){
            $("#formID").on("submit",function(event){
                $("#myform").validate();
                event.preventDefault();
          })
    });
    

    HTML:

提交回复
热议问题