this is the code that I came up with, but all it does is 1 + 1 = 11, I need it to do 1 + 1 = 2.
<head> <script type="text/javascript"> function startCalc(){ interval = setInterval("calc()",1); } function calc(){ one = document.form1.quantity.value; two = document.form1.price.value; c = one + two document.form1.total.value = (c); } function stopCalc(){ clearInterval(interval); } </script> </head> <body> <form name="form1"> Quantity: <input name="quantity" id="quantity" size="10">Price: <input name="price" id="price" size="10"><br> Total: <input name="total" size="10" readonly=true><br> <input onclick="startCalc();" onmouseout="stopCalc()" type="button" value="Submit"> </form> </body>
Of course, this is a really simple form, but you get the idea, please help me tell you what I'm doing wrong here.
source share