Validate prefilled jQuery form (invalidate on first field clear, ASP.NET and unobtrustive)

前端 未结 3 2039
庸人自扰
庸人自扰 2021-01-06 17:21

I have a form that can be filled, saved, loaded and re-edited.

When it is loaded and re-edited, it probably begins its life valid. When a field is valid upon

相关标签:
3条回答
  • 2021-01-06 17:41

    I've dug into the validation plug-in, and opened a ticket for what I believe is a defect.

    https://github.com/jzaefferer/jquery-validation/issues/146

    Shannon

    0 讨论(0)
  • 2021-01-06 17:52

    This constructor works for me:

    $('form').validate({
        onfocusout: function(element) {
           this.element(element);
        }, ...
    });
    
    0 讨论(0)
  • 2021-01-06 17:54

    You could try validating the form manually each time an input was changed.

    $(":input").live("change", function(){
        form.validate();
    })
    

    From looking at the documentation it seems that you can't call form.valid() without calling form.validate(); first.

    0 讨论(0)
提交回复
热议问题