MVC4 custom unobtrusive validator isn't working

守給你的承諾、 提交于 2019-12-05 12:16:17

figured it out. If anyone runs into this. Added custom validation too late on the page. After I moved my custom validation javascript to the head section of the _Layout.cshtml it started to work.

So if your script looks right, good place to check.

Another work around is to run $.validator.unobtrusive.parse('form'); which reloads all the validators.

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