hi there this is a total noob question, so hope someone can help!
i basically want to return a cost based on a formula.
formula idea is to get the option value from a drop-down list and based on its value return a number. for example if the value is "a" return '2'. for the sake of the formula call this var vechicleTypeCost.
i have worked out how to get the distance and the rate.
The purpose of the value attribute of the option tag is to provide an internal value that the webpage will use and that the user won't see. All the user will see is what's between <option>...</option>. So, why would you use value="a" when you really want value="2"?
In any case, it's something like this:
var optionElem = document.getElementById('optionElementId');
vehicleTypeCost = 2;
vehicleTypeCost = 3;
vehicleTypeCost = 4;
cost = (distance*rate)+vehicleTypeCost;