Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2011
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reset Multiple Drop-down Menus

    Hi,
    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.

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,620
    Thanks
    6
    Thanked 1,001 Times in 974 Posts
    You have two options – or actually you have only one option with two implementations:

    1. 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.
    2. 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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •