this is my function which is calculating values. But if any of the values is empty it does not calculate the total payment value. if there is any simple way to calculate pls let me know
function startCalc(){
interval = setInterval("calc()",1);}
function calc(){
room_charges = document.ipd_bill.room_charges.value ;
lab_charges = document.ipd_bill.lab_charges.value;
consultancy_fees = document.ipd_bill.consultancy_fees.value;
blood_charges = document.ipd_bill.blood_charges.value;
organ_charges = document.ipd_bill.organ_charges.value;
discount = document.ipd_bill.discount.value;
document.ipd_bill.total_payment.value = eval(room_charges) + eval(lab_charges) + eval(consultancy_fees) + eval(blood_charges) + eval(organ_charges) - discount;
}
function stopCalc(){
clearInterval(interval);
}