fetching the field values in function
-
HI there, again
I got the function to work finnaly, but when I try to fatch the fields value to vars, it not returning anything.if I assign a fix value to vars, like day = 2, days = 3 and so on…this is working perfect, but when I try to fetch the fields value to this, is not retutning anything.
how should I assign the fields value corectly, pls
this is the script:
<script>
function calcPrice(price, rate){
var priceret;
priceret = price + price*rate/100;
return priceret;
}function calcTotal (){
var day, days, year, rate, total, price;
day = fieldname2;
days = fieldname6;
years = fieldname11;
rate = fieldname7;
total = 0;
price = day * days;for (var i = 1; i <= years; i++){
price = calcPrice(price, rate);
total = total + price;
}return total;
}
document.getElementById(“fieldname12_1”).innerHTML = calcTotal();
</script>
- The topic ‘fetching the field values in function’ is closed to new replies.