title: jQuery - counter of filled in form inputs (updated on the fly)
body: <p>I have basic order form (4 inputs only for testing purposes), i want to count number of inputs (total items) where value is filled in and higher then 0 (basicaly how many products has been ordered, no to confuse with their quantities). When i add products is fine, problems start when I remove items( set them to 0). Could you help me to work it out.</p>
  
  <p>Working jsfiddle: <a href="http://jsfiddle.net/nitadesign/97tnrepg/33/" rel="nofollow">http://jsfiddle.net/nitadesign/97tnrepg/33/</a></p>
  
  <p>And few lines to bring your attention into a right place:</p>
  
  <pre><code>function GetOrder(curId){
  var order = null;
  
  for(i = 0; i&lt; orders.length; i++){
       if(orders[i].id == curId){
          order = orders[i];
          break;
      }
  }
  
  return order;
  }
  
  function CalculateTotal(){
  var total = 0;
  for(i = 0; i&lt; orders.length; i++){
      total = total + orders[i].packTotal;
  }
  console.log(total);
  
  if(total &gt; 0){
      $("#order_total").html('Total Items:' + i + '&lt;br&gt;' + 'Order Subtotal: ' + total);
      $("#order_total").show();
      $('.submitorder').show();
  }
  if(total == 0){
      $("#order_total").html('Your shopping basket is empty');
      $("#order_total").show();
      $('.submitorder').hide();
  }
  }
  </code></pre>
  
  <p>Thanks a lot for your help in advance!</p>