title: jQuery if value is empty set it to 0 and validate
body: <p>Simple Question I just cant solve, I have the following function:</p>
  
  <pre><code>function finalCheck(){
  
          var result = true;
          jQuery("#carloan-form :input[type=text]").each(function() {
  
              if(!this.value){this.value = 0;}
  
              if(jQuery.isNumeric(this.value) &amp;&amp; this.value&gt;=0) {
                  jQuery(this).parent().children('.cal-error').slideUp(300)
              }else{
                  result = false;
                  jQuery(this).parent().children('.cal-error').slideDown(300);
                  jQuery('.cal-result').slideUp(300);
              }
          });
          return result;
      }
  </code></pre>
  
  <p>basically the problem is <code>if(!this.value){this.value = 0;}</code> if there is no value i need to set it to zero before carrying on with the validating the form, but this only seems to take effect the second time i validate it.</p>
  
  <p>So it all boils down to if i set an inputs value to 0 in the each loop, it only takes it into account after the function is done.</p>
  
  <p>Here is a <a href="http://jsfiddle.net/bQSA3/3/" rel="nofollow"><strong>JSFIDDLE</strong></a>, Identical to my current problem, only on the second click will the proper value appear.</p>
  
  <p>Any Help Greatly Appreciated.</p>