MVC : How to enable client side validation on hidden fields
问题 @Scripts <script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")"></script> <script src="@Url.Content("~/Scripts/jquery.validate.js")"></script> <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.js")"></script> @View @using (Html.BeginForm("TestModelState", "RandD", FormMethod.Post, new {id="form123" })) { @Html.TextBoxFor(x => x.htmlText, new { style="display:none"})<br /> @Html.ValidationMessageFor(x => x.htmlText) <div> @Html.TextBoxFor(x => x.Uprop1)<br /> @Html