View Full Version : Reset Multiple Drop-down Menus

Seb Meikle
07-23-2011, 03:14 PM
I've tried find a script that can do this but I can only find ones that will only reset one drop down menu.

I have an order form in which the user can choose a product in white only, 1 colour choice, 2 colour choices or 3 colour choices.

If they select 1, 2 or 3 colour choices then choose white as all of their colours I have a message the flags up and tells them. What I need now is a script that will reset the drop down menus with the colour choices in.

Basically, I need a small script that will reset the colour choices drop down menus but not affect the rest of the form.

07-23-2011, 03:49 PM
You have two options – or actually you have only one option with two implementations:

A server side script checks the values on submission of the form and returns the same page with the error messages and the respective form controls reset.
A JavaScript checks the field values upon submitting the form, returns the errors via DOM manipulation, and resets the fields, cancelling the submit event.

The second option should only build upon (or be an enhancement of) the first option. Now, which forum should I move your thread to? PHP or JavaScript?