Is there a function in jquery.validate that will reset a single field like resetForm does for a form?

后端 未结 6 2316
旧巷少年郎
旧巷少年郎 2021-02-18 15:59

I want to call a jquery function to manually remove errors from a single field and reset the error markup. Is there a function that does this that would be similar to the reset

6条回答
  •  有刺的猬
    2021-02-18 16:10

    Can't find anything built in to the validation library but this hack works:

    $('#email').removeClass('error').next('label.error').remove();
    

提交回复
热议问题