Results 1 to 3 of 3

Thread: Chained select problem

  1. #1
    Join Date
    Jan 2009
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Chained select problem

    HI,

    I have a question about the Chained Selects script- By Xin Yang

    I just want to know how I can put one or two select more. The script works fine with the originals 3 select, but when I want to add one more, this last is empty..
    The new one should not be automaticly filled but well reset with the 3 others.

    Thank you for your help

    Didier

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format when asking a question.

    Please post a link to the page on your site that contains the problematic script so we can check it out.

    Please include your code so that we can take a look at it, we can't do much without it.
    Jeremy | jfein.net

  3. The Following User Says Thank You to Nile For This Useful Post:

    bugskiller (01-05-2009)

  4. #3
    Join Date
    Jan 2009
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Script : Chained Select
    Link : http://www.dynamicdrive.com/dynamici...menu/index.htm

    Here is my question again.
    How can I add one "select" when I use this script. I'm not really familiar with JS and when I trie to do it, it renders a "white select"...

    I can not give a link to my script because I'm still testing locally. But this is what I do..

    In the config.js

    Code:
    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", "");
    
    addList("Toyota", "Select vehicle type", "", "dummy-toyota");
    addList("Toyota", "Cars", "car", "Toyota-Cars");
    
    //-- new select to add
    addList("region", "Select your region", "", "dummy-region");
    addList("region", "Brussels", "Brussels", "");
    addOption("dummy-region", "Not available", "");
    In the php page :

    Code:
    <body onLoad="initListGroup('vehicles', document.forms[0].make, document.forms[0].type, document.forms[0].model, document.forms[0].region)">
    
    ....
    
    <form>
    <table align="center"><tr>
    <td>Select a vehicle:&nbsp;</td>
    <td><select name="make" style="width:160px;"></select></td>
    <td><select name="type" style="width:160px;"></select></td>
    <td><select name="model" style="width:160px;"></select></td>
    <td><select name="region" style="width:160px;"></select></td>
    <td><input type="button" value="Reset" onClick="resetListGroup('vehicles')">
    </tr></table>
    </form>
    So the problem is that the "region" doesn't depend of the cars but should be "reset" at the same time..

    thank you

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
  •