Hello, I am working on the form and it suppost to add a total simultaneously when you check a checkbox. The total displays on a text box. I have the following code..(function and form)
[code=php]
<form action=”scrcregconfirmation.htm” name=”form” method=”post” name=”scrc”>
<input name=”facconregistration” type=”checkbox” id=”facconregistration” value=”include” />
<input name=”facsrcmembership” type=”checkbox” id=”facsrcmembership” value=”include” />
<input name=”stuconregistration” type=”checkbox” id=”stuconregistration” value=”include” />
<input name=”stusrcmembership” type=”checkbox” id=”stusrcmembership” value=”include” />
<input name=”total” type=”text” id=”total” size=”8″ onChange=”getTotal(); return true;” />
<input type=”submit” name=”Submit” value=”Submit” />
</form>
and here is the functiion
[B]
function getTotal() {
var currency = “$”;
if(theForm.facconregistration.checked == true)
{
var subtotal1 = 165.00;
}
else if
((theForm.facconregistration.checked == true) && (theForm.facconmembership.checked == false))
{
var subtotal1 = 145.00;
}
if((theForm.stuconregistration.checked == true) && (theForm.stuconmembership.checked == true))
{
var subtotal2 = 100.00;
}
else if
((theForm.stuconregistration.checked == true) && (theForm.stuconmembership.checked == false))
{
var subtotal2 = 10.00;
}
var total = subtotal1 + subtotal2;
document.form.total.value = currency + total.toFixed(2);
}
[/B]
Does anyone know what im missing…thanks!!!