Results 1 to 6 of 6

Thread: Updating one dropdown with another

  1. #1
    Join Date
    Oct 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Updating one dropdown with another

    Firstly hello all!

    I have a drop down list box with values "A", "B" and "C".

    When I select for example "A" I wish for anothe drop down list box to populate with say "1", "2" and "3". If the user selects "B" in the first combo box the second will populate with "4", "5", "6" etc.

    Basically I wish to populate a second drop down list box with values dependant on what has been chosen in drop down box 1.

    Does that make sense?

    I have an onChange function call for the first combobox that will call a function which will hopefully populate the second combo box...

    I can get it to populate a standard field ala document.myform.mytextbox.value="test"; but this does not work with a <select> drop down box.

    Please help.

    Thanks

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

  3. #3
    Join Date
    Oct 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi boogyman. That doesnt really help me. I wish to populate a second drop down list after a selection from the first....

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Title has been updated to be more descriptive.
    When posting, use a title that summarizes the question. We know it's a javascript question, and simple isn't really helpful.

    In fact, this isn't all that simple. Easy concept, but the code can be a bit hard.

    Consider a few options--
    You could change the contents of a div to reflect what you want;
    You could rewrite the options for a select menu;
    Or you could swap several instances of the menu, perhaps the best option.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

  6. #6
    Join Date
    Aug 2005
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Thumbs up

    Chanied Selects work well, I've used this particular script a couple of times

Bookmarks

Posting Permissions

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