Hi,
I'll be grateful if anyone can help me with this query. I'm trying to create an online quote form. I have five combo boxes (combo1, combo2, combo3....) which are autoupdating on the basis of selection in the previous combo box. For each selection in the combo box there is some value attached to the selection. What I need is that as soon as the last combo box is selected, the HTML/script code should perform a calculation (basically multiply all the values) and display the result in a text box which has the readonly=true property. Code below is what I tried but nothing shows up in the text box names calc:
I'll be grateful if anyone can help me with this query. I'm trying to create an online quote form. I have five combo boxes (combo1, combo2, combo3....) which are autoupdating on the basis of selection in the previous combo box. For each selection in the combo box there is some value attached to the selection. What I need is that as soon as the last combo box is selected, the HTML/script code should perform a calculation (basically multiply all the values) and display the result in a text box which has the readonly=true property. Code below is what I tried but nothing shows up in the text box names calc:
Code:
function update()
{
var*combo1*=*document.getElementById("combo1");
var*combo2*=*document.getElementById("combo2");
var*combo3*=*document.getElementById("combo3");
var*combo4*=*document.getElementById("combo4");
var*combodelivery*=*document.getElementById("combo1delivery");
var*type*=*combo1.options[combo2.selectedIndex].value
var*standard*=*combo1.options[combo3.selectedIndex].value
var*level*=*combo1.options[combo1.selectedIndex].value
var*delivery*=*combo1.options[combodelivery.selectedIndex].value
var*length*=*combo1.options[combo4.selectedIndex].value
var total;
total = level * length * standard * type;
calc.value="£ "+Math.round(total);
}
Comment