title: IF Statement For Javascript
body: <p>I'm looking Jquery UI's <a href="http://jqueryui.com/demos/dialog/modal-form.html" rel="nofollow">modal form demo</a>. But i want to add something.
  This demo checking all inputs' (name,email,password)  lenght and validate them. But email input must be <em>optional</em>. Because of this i'm setting email input's min value (<em>for checkLength() function</em>) to zero. But when i leave blank email input i'm getting validation error. You can check full codes <a href="http://jsfiddle.net/teknoblogo/rFEj7/" rel="nofollow">here</a> .</p>
  
  <p>It's validation email with this code :</p>
  
  <pre><code>bValid = bValid &amp;&amp; checkRegexp( email, ..SOME REGEX PATTERNS WILL COME HERE.., "eg. ui@jquery.com" );
  </code></pre>
  
  <p>But i want to try validation only if there is any email input. Because email input is optional and visitors can leave it. How can i add <strong>if statement</strong> (if email input is filled, validate it. Else don't try validation) to this code ?
  I hope it's clear.</p>