using drop down boxes to filter data from a database

Discussion in 'Javascript' started by SirPoonga, Jan 7, 2005.

  1. SirPoonga

    SirPoonga Guest

    I think I'd have to do a combination of ASP and javascript to do this.
    What I want to do fill the first drop down box with values from a
    database query. Then based off that selection fill in the values of
    another drop down.

    Let's use the car industry as an example. Lets say I am storing in a
    database the data and relationships between car make, car type, and car
    model. So the first drop down box would like all makes. Upon
    selecting that the second dropdown will list all types (SUV, truck,
    sports car) that make has. That selection will drive the third drop
    down to list the models that match that make and type. All the data
    for that is stored in a database. How would I accomplish this?
     
    SirPoonga, Jan 7, 2005
    #1
    1. Advertising

  2. http://www.aspfaq.com/show.asp?id=2270

    Don't forget to list IHC as a vehicle manufacturer! All those damn car
    sites forget.

    --

    Ray at work
    Microsoft ASP/ASP.NET MVP


    "SirPoonga" <> wrote in message
    news:...
    > I think I'd have to do a combination of ASP and javascript to do this.
    > What I want to do fill the first drop down box with values from a
    > database query. Then based off that selection fill in the values of
    > another drop down.
    >
    > Let's use the car industry as an example. Lets say I am storing in a
    > database the data and relationships between car make, car type, and car
    > model. So the first drop down box would like all makes. Upon
    > selecting that the second dropdown will list all types (SUV, truck,
    > sports car) that make has. That selection will drive the third drop
    > down to list the models that match that make and type. All the data
    > for that is stored in a database. How would I accomplish this?
    >
     
    Ray Costanzo [MVP], Jan 7, 2005
    #2
    1. Advertising

  3. SirPoonga

    SirPoonga Guest

    Hehe, remember, I am using this as an example. What I really need to
    do is drive about 8 drop downs to filter out properties of some
    products. Once everything has been selected I need to generate the
    part numbers to create the product.
     
    SirPoonga, Jan 7, 2005
    #3
  4. SirPoonga

    Zi Guest

    I am doing a similar thing. I have been able to Load the second drop
    down on the change event of the first drop down. This is all done
    client side and is working like a dream. The problem is server side.
    When I do a post back, I have a watch on the second drop down list
    (dynamically loaded using JavaScript). The list is empty. It does not
    have any of the items I added on the client. If I do a
    "Request.Form.secondDropDown" this gives me the correct selected value
    of the drop down.

    Are the changes ignored on the server? Surly not... If not how do I get
    the server to recognise that I have made changes to the client.

    Kind Regards

    Ziyad Makki
    Software Systems Developer
    TTT Moneycorp Limited
     
    Zi, Feb 4, 2005
    #4
  5. SirPoonga

    Jeff Cochran Guest

    On 4 Feb 2005 02:45:11 -0800, "Zi" <> wrote:

    >I am doing a similar thing. I have been able to Load the second drop
    >down on the change event of the first drop down. This is all done
    >client side and is working like a dream. The problem is server side.
    >When I do a post back, I have a watch on the second drop down list
    >(dynamically loaded using JavaScript). The list is empty. It does not
    >have any of the items I added on the client. If I do a
    >"Request.Form.secondDropDown" this gives me the correct selected value
    >of the drop down.
    >
    >Are the changes ignored on the server?


    Actually, yes. The server will never know about anything on the
    client unless you tell it.

    >Surly not... If not how do I get
    >the server to recognise that I have made changes to the client.


    You have to send the changes back to the server. Form or query,
    unless the client tells the server what it did the server will never
    know. Once the server has sent the data that makes up the page,
    there's no connection to the client for the server to monitor.

    Jeff
     
    Jeff Cochran, Feb 4, 2005
    #5
  6. SirPoonga

    Ziyad Makki Guest

    Thanks for the reply Jeff!

    When you say "You have to send the changes back to the server. Form or
    query..." What do you mean exactly? Could you give me an example?

    I am already picking up the changes in the I have made using the
    Request.Form.secondDropDown.... Is this what you mean?

    Regards
    Zi

    > Actually, yes. The server will never know about anything on the
    > client unless you tell it.
    >
    >>Surly not... If not how do I get
    >>the server to recognise that I have made changes to the client.

    >
    > You have to send the changes back to the server. Form or query,
    > unless the client tells the server what it did the server will never
    > know. Once the server has sent the data that makes up the page,
    > there's no connection to the client for the server to monitor.
    >
    > Jeff
     
    Ziyad Makki, Feb 7, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SirPoonga
    Replies:
    2
    Views:
    792
    Ben Strackany
    Jan 7, 2005
  2. weiwei
    Replies:
    0
    Views:
    1,040
    weiwei
    Jan 5, 2007
  3. msimmons
    Replies:
    0
    Views:
    507
    msimmons
    Jul 16, 2009
  4. Replies:
    5
    Views:
    288
  5. Replies:
    3
    Views:
    304
Loading...

Share This Page