c# - in Mvc3 how could I disable validation on an input field when display:none? -
in jquery can disable validation input field client side (using ignore) , need same in mvc3
[displayname("title")] [required] public string title { get; set; } [displayname("othertitle")] [required] public string othertitle{ get; set; } in .cshtml
<div class="editor-label"> <span> @html.labelfor(x => x.title) </span> @html.dropdownlistfornums(m => m.title, new selectlist(new string[] { "mr", "ms", "mrs", "dr", "professor", "other" }, "title"), "title") </div> <div id="alttitle" class="editor-label"> <span> @html.labelfor(x => x.othertitle) </span> @html.textboxfor(x => x.othertitle, new { @class = "othertitle" }) </div> how disable validation on input field othertitle on client side, when "other" selected in dropdown can turn on again?
thanks
Comments
Post a Comment