Show/Hide content of a list based upon a value selected from a list
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Elisabeth_Bachler
Posted On:   Wednesday, July 19, 2006 08:36 AM

Hello, Let me explain my problem with a simple example (in reality, the values are read from a database). There are 2 type of cars: Opel Renault The colors can be: For Opel: Red or White For Renault: Black or Yellow. Now, the price depends on the type and on the color: Red Opel: x10 euros or x11 euros White Open: x20 euros or x21 euros Black Renauld: x30 euros or x31 euros Yellow Renault: x40 euros or x41 euros I would like to show first of all the type of cars. When   More>>

Hello,


Let me explain my problem with a simple example (in reality, the values are read from a database).


There are 2 type of cars:


  • Opel

  • Renault


    The colors can be:


  • For Opel: Red or White

  • For Renault: Black or Yellow.


    Now, the price depends on the type and on the color:


  • Red Opel: x10 euros or x11 euros

  • White Open: x20 euros or x21 euros

  • Black Renauld: x30 euros or x31 euros

  • Yellow Renault: x40 euros or x41 euros


    I would like to show first of all the type of cars.


    When the user choses the type, I would like to automatically show the possible colors for the chosen type.


    Once the color have been select, I would like to show the possible prices.


    Now, if the user clicks on the type again, the others fields have to disappear and only the color list should be shown.


    Could you please help me with it?


    THank you very much

  •    <<Less

    Re: Show/Hide content of a list based upon a value selected from a list

    Posted By:   Elisabeth_Bachler  
    Posted On:   Friday, July 21, 2006 08:36 AM

    Hello again,


    Here is what I have written so far and it is more or less working!. I have not reached the point where I have to hide the lists!


    I select a type of car and depending on what the user selects, different colors (related to the selected car) appear.


    There are a few problems though:


    - 1. I cannot manage to get the default value to be filled in upon init (I always get "No list available")


    - 2. I would like the 3rd field to depend on the 2nd field (like onchange="populate1()". I have tried it, but it does not seem to work.


    Could you help please?





















    About | Sitemap | Contact