title: How to extend jquery.validate URL validation?
body: <p>I have a need for users to be able to create partial URLs without needing to type the full URL each time.</p>
  
  <p>For example, say I plan on the url being <code>www.example.com/areas/{userinput}/home</code>. I want the user to be able to enter some text in a text box and I want to validate that it is a valid URL.</p>
  
  <p>The URL validator functions like this:</p>
  
  <pre><code>url: function(value, element) {
          return this.optional(element) || /giantregex/.test(value);
  }
  </code></pre>
  
  <p>I've attempted adding a validation method to the validator via the following: </p>
  
  <pre><code>$.validator.addMethod("exturl", function(value) {
      return $.validator.methods.url.call($.validator, "http://www.example.com/areas/" + value + "/home");
  });
  </code></pre>
  
  <p>However, when the form is validated and my extension is called, I keep getting this error:</p>
  
  <pre><code>Uncaught TypeError: Object function (d,a){this.settings=b.extend(true,{},b.validator.defaults,d);this.currentForm=a;this.init()} has no method 'optional' 
  </code></pre>
  
  <p><code>optional</code> looks to be a method on the <code>$.validator</code> object but I can't figure out how to call the validator url method.</p>