title: jquery form validate not allow space for field non required field?
body: <p>jquery form validate not allow space for field non required field
  i have tried this but is not working</p>
  
  <pre><code>$(document).ready(function(){
  
  jQuery.validator.addMethod("noSpace", function(value, element) { 
   return value.indexOf(" ") &lt; 0 &amp;&amp; value != ""; 
     }, "No space please and don't leave it empty");
  
  
  $("form").validate({
   rules: {
    name: {
        noSpace: true
    }
     }
      });
  
  
    })
  </code></pre>