title: using .trim() with jquery validate plugin
body: <p>I am using jQuery Live Form Validation from <a href="http://www.geektantra.com/2009/09/jquery-live-form-validation/" rel="nofollow">GeekTantra</a></p>
  
  <p>The validation is called by ID. Here is the code I use to set the options for a field that is a 2 digit number less than 50:</p>
  
  <pre><code>jQuery("#ValidNumber2Digits50").validate({
          expression: "if (VAL.length &lt;= 2 &amp;&amp; !isNaN(VAL) &amp;&amp; VAL &lt; 50) return true; else return false;",
          message: "Please enter a 2 digit number less than 50"
      });
  </code></pre>
  
  <p>The only problem is that it counts white spaces in the length. S0...</p>
  
  <pre><code>_4 ==&gt; good data 
  4_==&gt; good data
  _9_ ==&gt; bad data 
  _ _2 ==&gt; bad data
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>if (VAL.trim.length &lt;= 2 &amp;&amp; !isNaN(VAL) &amp;&amp; VAL &lt; 50) return true; else return false;
  </code></pre>
  
  <p>which did not work.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks in advance.</p>