title: Remove leading zeros while adding up values in two textboxes
body: <p>I have three textboxes, the values given in the first and second textbox will be summed and showed automatically, in the third textbox. My textboxes does not accept decimal values, i.e it accepts only whole numbers.</p>
  
  <p>The problem is, if I have leading zeros in the first two text boxes, it produces weird results in the third textbox.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    function getValues(val)
      {
      var carryVol=parseInt(document.getElementById('&lt;%=txtCarryOver.ClientID%&gt;').value)||0;
      var FreshVol=parseInt(document.getElementById('&lt;%=txtFreshVol.ClientID%&gt;').value)||0;
      var target=carryVol+FreshVol;
      document.getElementById('&lt;%=txtTotalVol.ClientID%&gt;').value=target;   
         }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;asp:TextBox ID="txtCarryOver" runat="server" Enabled="true" TabIndex="3" Width="150px"
                                          onkeyup="getValues(1)" onKeyDown="return validateQty(event)" MaxLength="3"                                             Height="13px"&gt;&lt;/asp:TextBox&gt;
  
  &lt;asp:TextBox ID="txtFreshVol" runat="server" Enabled="true" TabIndex="3" Width="150px"
                                          onkeyup="getValues(2)" onKeyDown="return validateQty(event)" MaxLength="3" Height="13px"&gt;&lt;/asp:TextBox&gt;
  &lt;asp:TextBox ID="txtTotalVol" runat="server" Enabled="true" TabIndex="3" Width="150px"
                                          onKeyDown="preventBackspace();" Height="13px"&gt;&lt;/asp:TextBox&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Also, I have already used onkeydown and onkeyup, help me to call the js function too, I always quite confused how to call a js function.</p>