I will try to keep it short and to the point, starting with the simple:
1. The values that are assigned to the various value attributes should be code-friendly and ease of processing. For example, the selDay, use "2" instead of "two" for the value attribute. if you do this way:
<option value="2">2</option>
then, it is very simple to get the value in JavaScript, like this:
cost = cost * document.reservation.selDay.value
This applies to the selBag too, that is for you to figure out.
2. Use checkboxes when you allow multiple selection. That is not the case for the pet option. It is either Yes or No. How many checkboxes do you need in the case? The hint is every checkbox has 2 states, i.e. checked or unchecked. Say you have a checkbox named as "hasPet" and to detect that in JavaScript, do this:
document.reservation.hasPet.checked
Keep thinking...
Now the more difficult...
3. Use JSON to store the hotel names and their corresponding costs as key-value pairs, in this way, you can get the cost for the selected hotel in JavaScript. For example:
var hotels =[
{"name":"Omaha", "cost":"200"},
{"name":"Nashville", "cost":"250"},
{"name":"Detroit", "cost":"150"}
];
add a value attribute that takes the hotel name for each radCity radio buttons, like this:
<input type ="radio" name="radCity" value="Omaha">
then, use a for loop to get the cost:
for(i=0; i < hotels.length; i++){
if (hotels[i].name == document.reservation.radCity.value) {
cost = parseFloat(hotels[i].cost);
break;
}
}
Do the same for the radHotel radio button.
Read more:
JSON Tutorial[
^]
That is all that I can say for now. Enjoy your coding...