title: How to use IF ELSE condition inside Rule of jquery.validate.js
body: <p>How to use the IF ELSE condition inside the RUle function in Jquery Validation.</p>
  
  <p>I am using one form for some fields are require for option 1 and some fields are require for option 2. </p>
  
  <p>Example</p>
  
  <p>for the below code I need name and address for option one and name and url for option 2. How to use the IF/Else condition for this.</p>
  
  <pre><code> $(document).ready(function(){      
          $("#demo-form").validate({    
            rules: {
              name: "required",
              address: "required",
              url: "required url",
              integer: {
          required:true,
          integer:true,
          min: 5
          },
         }
         });
  </code></pre>