Is it impossible or am I not lucky enough to get an answer after a long search: how to validate optional fields with default value?

Is it impossible or am I not lucky enough to get an answer after a long search: how to validate optional fields with default value?

Hi,

I made some changes to the following example:

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
  2.                     "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5.   <script src="http://code.jquery.com/jquery-latest.js"></script>
  6.   <script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js"></script>
  7. <style type="text/css">
  8. * { font-family: Verdana; font-size: 96%; }
  9. label { width: 10em; float: left; }
  10. label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
  11. p { clear: both; }
  12. </style>
  13.   <script>
  14.   $(document).ready(function(){
  15.     $("#commentForm").validate();
  16.   });
  17.   </script>

  18. </head>
  19. <body>


  20.  <form class="cmxform" id="commentForm" method="get" action="">
  21.  <fieldset>
  22.    <legend>A simple comment form with submit validation and default messages</legend>
  23.    <p>
  24.      <input id="cname" name="name" size="25" class="required" value="Name" onfocus="if (this.value == 'Name') {this.value=''}" onblur="if(this.value == '') { this.value='Name'}" />
  25.    </p>
  26.    <p>
  27.      <input id="cemail" name="email" size="25"  class="required email" value="Email" onfocus="if (this.value == 'Email') {this.value=''}" onblur="if(this.value == '') { this.value='Email'}" />
  28.    </p>
  29.    <p>
  30.      <input id="curl" name="url" size="25"  class="url" value="URL" onfocus="if (this.value == 'URL') {this.value=''}" onblur="if(this.value == '') { this.value='URL'}" />
  31.    </p>
  32.    <p>
  33.      <textarea id="ccomment" name="comment" cols="35" rows="5" class="required" onfocus="if (this.value == 'Comment') {this.value=''}" onblur="if(this.value == '') { this.value='Comment'}">Comment</textarea>
  34.    </p>
  35.    <p>
  36.      <input class="submit" type="submit" value="Submit"/>
  37.    </p>
  38.  </fieldset>
  39.  </form>
  40. </body>
  41. </html>

I know how to add custom validation methods for the required fields Name, E-mail, and Comment. But I just don't know how to validate the optional filed URL. I've searched everywhere to no avail!

Any help is greatly appreciated!
Desparate