Results 1 to 2 of 2

Thread: Chained Selects - What do these 2 lines do?

  1. #1
    Join Date
    Sep 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Chained Selects - What do these 2 lines do?

    Script: http://www.dynamicdrive.com/dynamici...edselects.html

    In the following code snippet, what are the last two lines doing?

    Code:
    var hide_empty_list=true;
    
    addListGroup("vehicles", "car-makers");
    
    addList("car-makers", "Select a maker", "", "dummy-maker");
    addList("car-makers", "Toyota", "Toyota", "Toyota");
    addList("car-makers", "Honda", "Honda", "Honda");
    addList("car-makers", "Chrysler", "Chrysler", "Chrysler", 1);
    
    addList("dummy-maker", "Not available", "", "dummy-car");
    
    addOption("dummy-car", "Not available", "");
    Thanks!

  2. #2
    Join Date
    Aug 2004
    Posts
    10,140
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    The 2nd to last line corresponds to the 2nd level select menu for the 1st level's first item ("Select A Maker"). In other words, choosing "Select a Maker" in turn results in the 2nd level menu showing "Not Available." The last line does the same for the 2nd level menu.

    It's a little confusing, but you just need to look at it hard enough.

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
  •