禁用启用不显眼的验证 mvc
我有一个向导,其中包含一个非常大的表单。该向导有一个区域,用户可以在其中选择两个选项之一,这两个选项显示和隐藏带有其他输入元素的 div。问题是隐藏的元素正在被验证,我需要关闭这些某些元素的验证。
我尝试过: $('.data-panel').find('input[type="text"], textarea, select').attr('禁用', '禁用');
作为该线程中的状态,但它仍然会验证这些输入元素。 MVC3 低调验证:如何从一组元素中删除/重新附加验证?
我考虑过注入/删除部分视图,但这些元素在需要验证时不会进行验证。
我愿意接受任何解决办法。 谢谢!
I have a wizard which contains a very large form. The wizard has an area where the user chooses one of two options which shows and hides a div with other input elements. The problem is that the hidden elements are being validated and i need to turn validation off on those certain elements.
I've tried:
$('.data-panel').find('input[type="text"], textarea, select').attr('disabled', 'disabled');
as state in this thread, but it will still validate those input elements.
MVC3 unobtrusive validation: how to remove/re-attach validation from a group of elements?
I thought about injecting/remove a partial view, but those elements won't validate when they need to be validated.
I'm opening for any work arounds.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
禁用:
启用:
To disable:
To enable: