title: jQuery Validate plugin, one out of two fields is required
body: <p>I have a form with 2 fields; mobile no. and telephone no.</p>
  
  <p>at least 1 of the fields has to be filled in, but both can also be filled.</p>
  
  <p>I need jquery validate to throw an error if none of them are filled only.</p>
  
  <p>I have achieved this with:</p>
  
  <pre><code>rules: {
              mobile:{
                  required: {
                      depends: function(element) {
                          return $("#regTelephone").val() === '';
                      }
                  }
              },
              telephone:{
                  required: {
                      depends: function(element) {
                          return $("#regMobile").val() === '';
                      }
                  }
              }
  }  
  </code></pre>
  
  <p>however, if only one field is empty, this field still gets the 'valid' class, which I don't want as my valid css has a green border (so the empty field still gets a green border)</p>
  
  <p>so: how do I get the field which is empty (providing the other has a value) to not get the valid class and therefore the green border?</p>