title: jQuery disable rule validation on a single field
body: <p>I am using MVC to create forms that are generated at runtime. For validation, I am trying my hand at the jQuery validation library which is very convenient to use. I have the validation expression of each field in the <em>cdata</em> attribute of the tag</p>
  
  <pre><code>&lt;input type="text" name="xyz" id="xyz" class="defaultTextBox"
    cdata="{validate:{required:true, decimal:true, messages:
            {required:'Please enter an decimal value', 
             decimal:'Please enter a valid decimal'}}}"&gt;
  </code></pre>
  
  <p>This works beautifully. Now one more requirement I have is that some fields are being shown and hidden according to the logic on the page and I need to disable the validation on the hidden fields such that they do not interfere with the form submission. Just toggling the required:true to false and back to true should be enough. Only i do not know how.</p>
  
  <p>Anyone has any experience with that?</p>