How to manually revalidate / trigger validation using unobtrusive jQuery validation?

房东的猫 提交于 2019-12-01 15:48:22

I had a similar problem where I wanted to revalidate a datepicker field using jquery validate and jquery ui. This post helped me figure it out.

The key, is just add a callback to the valid method for that selector. Something like:

$(".requiredif").change(function() {
  $(this).valid();
})

You should check out Foolproof Validation. It does what you are trying to do without you having to roll your own.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!