Hi there,
I need to calculate a price based on selections made by the client. The following works fine, but I would need to add some extra options which I will explain below the code.
Now I would need an extra drop down box which holds dynamic data. There are two possibilities. Either the value starts with REG or with DIS, so REG has a price and DIS has a price. Unfortunately the whole value will be something like REG0001, REG0002 and so on. The dropdown will mostlikely hold multiple REG or DIS values.Code:function calculatePrice() { ammount = 0; //Calculating prices if (document.reg.fee[0].checked) { ammount = parseInt(ammount + 995); } if (document.reg.fee[1].checked) { ammount = parseInt(ammount + 1395); } if (document.reg.fee[2].checked) { ammount = parseInt(ammount + 645); } if (document.reg.fee_accomp_person.checked) { ammount = parseInt(ammount + 100); } // Total that will be displayed document.reg.fee_total.value = parseInt(ammount); }
Is there a why with Javascript to check only the first three letters to find out which price is applicable? (Wildcard)
How whould I address a drop down box? something like document.reg.dropdown.value ?
Thanks for any help,
regards ASchweti







Bookmarks