Linking Combo Box's Contents together

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • nicechap
    Private

    • Jun 2008
    • 3

    Linking Combo Box's Contents together

    Hi All,

    I am new here but I need your help in acheiving a goal concerning my pet website.

    I have a combo box with some items listed e.g.
    -Item A
    -Item B
    -Item C
    -Item D

    When a user selects a particular item, I want another combo box to be populated with another sets of items relating to the item selected in the first combo box field. For example,

    if Item A is selected, then the second combobox should have the following lists
    --Item A1
    --Item A2
    --Item A3
    --Item A4

    if Item B is selected, then the second combobox should have the following lists
    --Item B1
    --Item B2
    --Item B3

    if Item C is selected, then the second combobox should have the following lists
    --Item C1
    --Item C2
    --Item C3
    --Item C4

    I hope my explanation is clear.

    Please somebody should help me out.

    Regards,
    nicechap.
  • navaldesign
    General & Forum Moderator

    • Oct 2005
    • 12080

    #2
    Re: Linking Combo Box's Contents together

    What you ask for requires some degree of experience or a tool to achieve.
    You can do it in two ways:
    1. Using Javascript, with embeddd in the page JaVascript. Have a look at http://www.dbtechnosystems.com/Tips/...drop_downs.php
    This is a three level dependent drop down based on a script found (if i recall well) on Dynamic Drive and modified from the original two level.
    2. Using Ajax (which is Javascript plus a server side programming language like php or Perl). Have a look at this application i made for a client of mine: http://www.evansconstructionpages.com/

    When you select a State, the counties dropdown is automatically populated, the same for categories and subcategories. This is the best solution if you have too many values (in this case, thousands).

    Search the net, there are dropdown creation tools if you have only a few values and you can make it with simple Javascript
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

    Comment

    Working...
    X