I received help with this calculator for a form that I am building, and was wondering if there is anyway to build it without having to use the buttons to total the totals and subtotal. The address where the form is is <!-- m --><a class="postlink" href="http://www.arrowheadgloves.com/form.htm">http://www.arrowheadgloves.com/form.htm</a><!-- m -->. Below is the code that i received from a helpful member of webdeveloper!
Any and all help will be appreciated!
<html>
<head>
<script language="javascript" type="text/javascript">
function add()
{
var one = document.test.value1.value;
var two = Number(one) * 60;
document.test.subtotal.value = two;
}
function add2()
{
if (document.test.value2.value != "")
{
var one2 = document.test.value2.value;
var two2 = Number(one2) * 72;
document.test.newsubtotal.value = two2;
}
}
function add3()
{
var one3 = document.test.subtotal.value;
var two3 = document.test.newsubtotal.value;
document.test.total.value = Number(one3) + Number(two3);
}
</script>
</head>
<body>
<form action="" name="test">
<input name="value1">+60 = <input name="subtotal"><br>
<input name="value2">+72 = <input name="newsubtotal"><br>
Total = <input name="total"><br>
<input type="button" onClick="add(); add2();" value=http://www.webdeveloper.com/forum/archive/index.php/"add">
<input type="button" onClick="add3();" value="total"><br>
</form>
</body>
</html>
Any and all help will be appreciated!
<html>
<head>
<script language="javascript" type="text/javascript">
function add()
{
var one = document.test.value1.value;
var two = Number(one) * 60;
document.test.subtotal.value = two;
}
function add2()
{
if (document.test.value2.value != "")
{
var one2 = document.test.value2.value;
var two2 = Number(one2) * 72;
document.test.newsubtotal.value = two2;
}
}
function add3()
{
var one3 = document.test.subtotal.value;
var two3 = document.test.newsubtotal.value;
document.test.total.value = Number(one3) + Number(two3);
}
</script>
</head>
<body>
<form action="" name="test">
<input name="value1">+60 = <input name="subtotal"><br>
<input name="value2">+72 = <input name="newsubtotal"><br>
Total = <input name="total"><br>
<input type="button" onClick="add(); add2();" value=http://www.webdeveloper.com/forum/archive/index.php/"add">
<input type="button" onClick="add3();" value="total"><br>
</form>
</body>
</html>