I'm a beginner at jscript so go easy. I'm not sure why this isn't working and it's probably something really simple, but here's my code snippet, any help on this would be greatly appreciated.
function calculate()
{
ValA = 0; ValB = 0; ValC = 0; ITCPer = .35
TotA = 0; TotB = 0; TotC = 0;
if (document.getElementById("valA").value > "")
{ ValA = document.getElementById("valA").value };
document.getElementById("val").value = eval(ValA);
if (document.getElementById("valB").value > "")
{ ValB =document.getElementById("valB").value };
document.getElementById("valB").value = eval(ValB);
if (document.getElementById("valC").value > "")
{ ValC = document.getElementById("valC").value };
document.getElementById("valC").value = eval(ValC);
if (document.getElementById("ITCPer").value> "")
{ ITCPer = document.getElementById("ITCPer").value };
document.getElementById("ITCPer").value = eval("ITCPer");
TotA = ValA + ValB + ValC * ITCPer;
document.getElementById("totalA").value = leeAmt(eval(TotA));
Totamt = eval(TotA);
document.getElementById("GrandTotal").value = leeAmt(eval(Totamt));
}
I think it's pretty clear, I want ValA, B, C to add and multiply by ICTPer to give me a grand total. However, it doesn't calculate at all.
Help! (Or direct me to a thread that has addressed this issue, that's good too!)