Ok I have a calulate button to add up totals for housing appraisals. This is my code.
function calculate()
{
if (document.prices.single.value > "0")
{
total = document.prices.single.value * 500;
document.prices.total.value = total;
}
if (document.prices.two.value > "0")
{
total = document.prices.two.value * 750;
document.prices.total.value = document.prices.total.value + total;
}
if (document.prices.duplex.value > "0")
{
total = document.prices.duplex.value * 850;
document.prices.total.value += total;
}
if (document.prices.multi.value > "0")
{
total = document.prices.multi.value * 1000;
document.prices.total.value += total;
}
if (document.prices.condo.value > "0")
{
total = document.prices.condo.value * 1500;
document.prices.total.value += total;
}
}
The code works if you only have 1 value, but if I have more than 1 it doesn't add them. Any suggestions?