var totalothertax = document.form1.totalothertax.value;
if (!totalothertax) {
totalothertax = 0.00;
}else{
var totalothertax = 0.00;
for (var i=1; i<=taxCount; i++ ){
var taxpercentid = "taxpercent"+i;
var taxpercent = document.getElementById(taxpercentid).value;
var taxamountid = "taxamount"+i;
var taxamount = eval(taxpercent) * eval(principalprice)/100;
if (principalprice){
document.getElementById(taxamountid).value=taxamount;
totalothertax = totalothertax + taxamount;
}
}
document.form1.totalothertax.value=totalothertax;
}
javascript auto sum
Started by niurexx, Dec 10 2008 08:27 PM
1 reply to this topic
#1
Posted 10 December 2008 - 08:27 PM
can some tell me how to change the array value form 1..2..3..4 into [1]..[2]..[3]..[4].. from this javascript code..
#2
Posted 11 December 2008 - 01:29 AM
Technically speaking, there are no array's in that code. Could you be more specific as to which value you want changed?
Note: Assuming you're simply talking about the final amount though, a simple example would be:
Note: Assuming you're simply talking about the final amount though, a simple example would be:
document.form1.totalothertax.value= '['+totalothertax+']';
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
