I have a form that a customer enters a price in to one box and then they enter it in to another. I need these to add up and present themselves in another box within the same form. Is this possible, and if there is, is there a tutorial anywhere out there that could do this?
JavaScript or PHP Help ...
Started by trauma, Aug 18 2006 02:11 PM
2 replies to this topic
#1
Posted 18 August 2006 - 02:11 PM
#3
Posted 18 August 2006 - 09:51 PM
you'd have something like
<script type="text/javascript">
function addup() {
var price1 = (document.getElementById('price1').value * 1);
var price2 = (document.getElementById('price2').value * 1);
var total = price1 + price2;
document.getElementById('total').value = total;
}
</script>
<form action="" method="POST">
<input type="text" id="price1" name="price1" onchange="addup();" />
<input type="text" id="price2" name="price2" onchange="addup();" />
<input type="text" id="total" name="total" />
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
