Manual form validation in MVC 3 and JQuery

后端 未结 4 1435
旧巷少年郎
旧巷少年郎 2020-12-09 05:01

I want to be able to trigger form validation on the client side when the user selects the \"GO\" button. Currently when the \"GO\" button is selected it does not validate th

4条回答
  •  一生所求
    2020-12-09 05:30

    Not sure if you figured this out yet, but I ran into the same thing in IE with $("#myForm").submit. Use live:

    $("#myForm").live('submit', function (e) {
        var val = $('#myForm').validate(); //<--added the semi-colon
        val.showErrors();
        alert(val.valid());
    
    
        e.preventDefault();
    });
    

提交回复
热议问题