title: jQuery Validate by ID and form group
body: <p>I need to validate by id and not input name because my input name is data[name]. I also have a rule to allow one or both fields.</p>
  
  <p>I can add the rules with id but I cannot combine both rules. Is there a way.</p>
  
  <pre><code>&lt;input id="email" type="email" class="form-control contact-method" name="data[email]" placeholder="Email"&gt;
  &lt;input id="phone" type="text" class="form-control contact-method" name="data[phone]" placeholder="Phone"&gt;
  </code></pre>
  
  <p>Js Code:</p>
  
  <pre><code>$('#requestDemo').validate({  // &lt;- attach '.validate()' to your form
      debug: false,
      errorElement: "span",
      errorClass: "help-block",
      rules: {
          phoneInput: {
              require_from_group: [1, ".contact-method"]
          },
          emailInput: {
              require_from_group: [1, ".contact-method"]
          }
      },
  </code></pre>