title: JQuery Validate Options not working MVC3 Razor
body: <p>I am trying to get a simple ignore working for the JQuery validate and I dont seem to be able to get it to work.  No matter what I do it seems to not use the options.  I have trimmed the code down and pasted below.</p>
  <p>I am using MVC3 Razor and JQuery 1.5.1</p>
  <pre><code>@Code
      ViewData(&quot;Title&quot;) = &quot;Index&quot;
      Layout = &quot;~/Areas/Quote/Views/Shared/_Layout.vbhtml&quot;
  End Code
  &lt;script type=&quot;text/javascript&quot;&gt;
      $(document).ready(function () {
          $('#myform').validate({
              ignore: &quot;#textx&quot;
          })
      });
  &lt;/script&gt;
  @Using Html.BeginForm(&quot;Index&quot;, &quot;YourQuote&quot;, FormMethod.Post, New With {.id = &quot;myform&quot;})
      @&lt;input  type=&quot;text&quot; id=&quot;textx&quot; class=&quot;required&quot;/&gt;
      @&lt;input type=&quot;submit&quot; value=&quot;save&quot; /&gt;
  End Using
  </code></pre>
  <p>The example is simplified but what I really want to do is have an overriding rule which says ignore all hidden elements from validation. My page is dynamically built and removing class and adding them back in when parent elements are hidden or shown is not good for me</p>
  <pre><code>@Code
      ViewData(&quot;Title&quot;) = &quot;Index&quot;
      Layout = &quot;~/Areas/Quote/Views/Shared/_Layout.vbhtml&quot;
  End Code
  &lt;script type=&quot;text/javascript&quot;&gt;
      $(document).ready(function () {
          $('#myform').validate({
              ignore: &quot;:hidden&quot;
          })
      });
  &lt;/script&gt;
  @Using Html.BeginForm(&quot;Index&quot;, &quot;YourQuote&quot;, FormMethod.Post, New With {.id = &quot;myform&quot;})
      @&lt;div style=&quot;display:none&quot;&gt;
      &lt;input  type=&quot;text&quot; id=&quot;textx&quot; class=&quot;required&quot;/&gt;
      &lt;/div&gt;
      @&lt;input type=&quot;submit&quot; value=&quot;save&quot; /&gt;
  End Using
  </code></pre>