Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个由正则表达式控制的文本框:
[RegularExpression("[0-5]{1}[0-9]{1}:[0-5]{1}[0-9]{1},[0-9]{2}")] public string HighestValueStringDistance { get; set; }
它工作正常,但有时文本框是不可见的(使用 javascript)只有当它不可见时,如何才能将其设置为空?
谢谢
利用:
jQuery.validator.defaults.ignore = ":hidden"; // the line above is outside any $(document).ready(...) or similar $(document).ready(function(){ ... }); ...
来源:MVC 3 不显眼的验证 - 有条件地禁用/启用验证