hi,
being relatively new to javascript i have come across a problem…picture this…..
function row(){
document.formsum.TOTAL1.value = document.formsum.QUANTITY1.value * document.formsum.UNITPRICE1.value – ((document.formsum.QUANTITY1.value
ok, the above is (most likely) a long handed way of working out the total of a sum entered into said textboxes, so if the QUANTITY =1, the UNITPRICE=10, and the DISCOUNT=10(%), then the total would be 9. ok……..
next is a second row of the same thing, only numbered ‘2’….
document.formsum.TOTAL2.value = document.formsum.QUANTITY2.value * document.formsum.UNITPRICE2.value – ((document.formsum.QUANTITY2.value
so we have 2 rows working out 2 sums……
the next bit is where it gets wierd!….
A=document.formsum.Total1.value
B=document.formsum.Total2.value
C=(A+?
document.formsum.SubTotal.value=C
}
i would have thought that that A+B would add the values of the two textboxes and put it in the SUBTOTAL textbox, instead it appends total2 to total1 (i.e. if total1 = 10 and total2 = 2, it does not produce 12, but 102 ’10 and 2′)
i thought this odd so i tried C=(A*? and it works perfectly, it multiplies the values of the 2 textboxes together, but upon changing the
what am i doing wrong???
many thanks
david
(ps apologies to all the scripters who cringed at the scripting!!)