ASP.NET MVC 3 检查页面是否验证
我如何检查表单/页面是否经过验证?
例如
if ($('.uiModalContent > form') HAS VALIDATION) {
$.validator.unobtrusive.parseDynamicContent('.uiModalContent');
}
How would I check if a form / page had validation on it?
e.g.
if ($('.uiModalContent > form') HAS VALIDATION) {
$.validator.unobtrusive.parseDynamicContent('.uiModalContent');
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这里是在黑暗中进行的温和拍摄,但您可能会检查为什么
不直接解析内容?
A mild shot in the dark here but you could potentially check if
Why not just parse the content anyways?
这有点 hacky,但您可以计算验证对象中验证规则的数量。也许是这样的:
然后在你的 if 语句中调用:
只是一个想法......
This is a bit hacky but you could count the number of validation rules in the validate object. Maybe something like this:
and then in your if statement call:
Just an idea...
我在自己寻找答案时遇到了这个问题,但收效甚微。所以我开始玩萤火虫和一些形式并想出了:
I came across this question while searching for the answer to it myself with little success. so i started playing with firebug and some forms and came up with: