title: jQuery - sum every input value in a form
body: <p>I'd like to count the sum of all the numeric values of a lot of input fields inside a form, every time one of the values changes.
  I think this code is quite closer, but when I change twice the same input it is wrong.</p>
  
  <pre><code>tot = 0;
  $('form#form-id :input').change(function(){
    $("form#form-id :input").each(function(){
      tot += Number($(this).val());
    });
    console.log(tot);
  });
  </code></pre>
  
  <p>This also seems to works well on jsFiddle
  <a href="https://jsfiddle.net/yq9zenaz/" rel="nofollow">https://jsfiddle.net/yq9zenaz/</a> but I get NaN on production. </p>