using drop down boxes to filter data from a database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • SirPoonga

    using drop down boxes to filter data from a database

    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]

    #2
    Re: using drop down boxes to filter data from a database



    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" <kevin.jonas@gm ail.com> wrote in message
    news:1105125394 .935683.96680@z 14g2000cwz.goog legroups.com...[color=blue]
    > 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?
    >[/color]


    Comment

    • SirPoonga

      #3
      Re: using drop down boxes to filter data from a database

      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.

      Comment

      • Zi

        #4
        Re: using drop down boxes to filter data from a database

        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.s econdDropDown" 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

        Comment

        • Jeff Cochran

          #5
          Re: using drop down boxes to filter data from a database

          On 4 Feb 2005 02:45:11 -0800, "Zi" <ziyad.makki@tt t.co.uk> wrote:
          [color=blue]
          >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?[/color]

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

          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

          Comment

          • Ziyad Makki

            #6
            Re: using drop down boxes to filter data from a database

            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.se condDropDown... . Is this what you mean?

            Regards
            Zi
            [color=blue]
            > Actually, yes. The server will never know about anything on the
            > client unless you tell it.
            >[color=green]
            >>Surly not... If not how do I get
            >>the server to recognise that I have made changes to the client.[/color]
            >
            > 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[/color]


            Comment

            Working...