I have a dropdown list with a few options and a group of checkboxes that should be available only if the user selects some particular options while filling the form.
Then, there’s a group of checkboxes (4 checkboxes), 3 of which have class=”extrasB” and that should be available for selection only if user has chosen the last 2 options in the select (5,6).
Each selected checkbox of the above adds an extra cost (it’s value) to the total cost of the form (field scost). Let’s say that the user selects option 5, selects some checkboxes and then decides he want’s option 3 (no checkboxes). This should automatically un-select the already checked checkboxes and change the value of scost. How do I do this?
Here’s a jsfiddle with all of the above in working order.
Change your function like this
Edit: JsFiddle