esthera
03-15-2009, 09:25 AM
I have
function dototal()
{
tamount=parseInt(document.myform.amount1.value)+parseInt(document.myform.amount2.value)+parseInt(doc ument.myform.amount3.value);
document.getElementById('total').innerHTML=tamount;
}
the problem is if amount is blank it can't add it -- how can I change it that if it is blank it should treat it as 0?
function dototal()
{
tamount=parseInt(document.myform.amount1.value)+parseInt(document.myform.amount2.value)+parseInt(doc ument.myform.amount3.value);
document.getElementById('total').innerHTML=tamount;
}
the problem is if amount is blank it can't add it -- how can I change it that if it is blank it should treat it as 0?