title: MVC : How to enable client side validation on hidden fields
body: <p><strong>@Scripts</strong></p>
  
  <pre><code> &lt;script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")"&gt;&lt;/script&gt;
    &lt;script src="@Url.Content("~/Scripts/jquery.validate.js")"&gt;&lt;/script&gt;
    &lt;script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.js")"&gt;&lt;/script&gt;
  </code></pre>
  
  <p><strong>@View</strong></p>
  
  <pre><code>@using (Html.BeginForm("TestModelState", "RandD", FormMethod.Post, new {id="form123" }))
  { 
      @Html.TextBoxFor(x =&gt; x.htmlText, new { style="display:none"})&lt;br /&gt;
      @Html.ValidationMessageFor(x =&gt; x.htmlText)
      &lt;div&gt;
        @Html.TextBoxFor(x =&gt; x.Uprop1)&lt;br /&gt;
        @Html.ValidationMessageFor(x =&gt; x.Uprop1)
      &lt;/div&gt;
      &lt;input type="submit" value-="Submit" onclick="abc()" /&gt;
  }
  </code></pre>
  
  <p><strong>WHAT I have tried</strong></p>
  
  <ol>
  <li>Replaced <em>ignore: ":hidden",</em> with <em>ignore: ""</em>, inside validate.js</li>
  <li><p>var validateMeta = $('#form123').validate();
          validateMeta.settings.ignore = "";</p></li>
  <li><p><code>$.validator.setDefaults({ignore: ""});</code></p></li>
  <li><p><code>$.validator.setDefaults({ ignore: [] });</code></p></li>
  </ol>