Question by ncp905: Does anyone know how to fix this javascript file?
I’m working on the below javascript page and everything works but the area that collects the pizza toppings checkboxes that are =true and puts the topping prices into the toppings variable. I keep getting an error saying that ‘checkboxes’ is undefined. Does anyone know how to fix this? Also is there anywhere on the web where I can debug this script so I would know the the line that’s truly causing the error? IE7 tends to point to the wrong lines when there’s an error whether runtime or syntax.

Thanks
————————————————————————–

Name:
Select a size:
Select a crust: Thin

Thick

Deep Dish
Select Options: Anchovies - $.75

Extra Cheese - $.75

Extra Sauce - $.50

Mushrooms - $.25

Pepperoni - $.50

Pineapple - $.25
 

Best answer:

Answer by §©®Î¶†?®
I re-worked your form and your JavaScript. Since Y!A won't let me send all of the code, I'll post it here:

http://scriptar.com/JavaScript/pizza.html

Your checkboxes should be uniquely named because more than one can be chosen. When you submit the form, check for each checkbox's existence instead of a sending a particular price (or else you won't know what the user picked). You should try to avoid using tables for non-tabular data. Try using definition lists and fieldsets with CSS for a better form layout. Also, always use label tags for increased usability.

Give your answer to this question below!