pass 2 text box
<p>I'm new to javascript and I am trying to pass 2 textbox values into a function and update a third text box with the result. I have tried using this:</p>

<pre><code>    function setamount(input1,input2,input3) {
        alert(input1);
        var amnt1=parseInt(document.getElementById(input1).value);
        var amnt2=parseInt(document.getElementById(input2).value);
        var total=amnt1+amnt2;

        document.getElementById(input3).value=total;
    }

&lt;input type="text" id="amnt1" maxlength=3 /&gt;
&lt;input type="text" id="amnt2" maxlength=3 onBlur="setamount('amnt1','amnt2','total');"/&gt;
&lt;input type="text" id="total"  /&gt;
</code></pre>

<p>It stops working while im trying to calculate the total. Is there something I have wrong. I just cant seem to get this to work. I have tried a lot of different ways but I cannot add the numbers together and assign it to the total???</p>

<p>Any help would be appreciated. </p>

<p>Thanks in advance</p>
