Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > using drop down boxes to filter data from a database

Reply
Thread Tools

using drop down boxes to filter data from a database

 
 
SirPoonga
Guest
Posts: n/a
 
      01-07-2005
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?

 
Reply With Quote
 
 
 
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      01-07-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> 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?
>



 
Reply With Quote
 
 
 
 
SirPoonga
Guest
Posts: n/a
 
      01-07-2005
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.

 
Reply With Quote
 
Zi
Guest
Posts: n/a
 
      02-04-2005
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

 
Reply With Quote
 
Jeff Cochran
Guest
Posts: n/a
 
      02-04-2005
On 4 Feb 2005 02:45:11 -0800, "Zi" <(E-Mail Removed)> 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
 
Reply With Quote
 
Ziyad Makki
Guest
Posts: n/a
 
      02-07-2005
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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Affecting a dynamically created drop down from another dynamically created drop down. msimmons ASP .Net 0 07-16-2009 03:17 PM
retrive preselected value in second drop down list from the first drop down list weiwei ASP .Net 0 01-05-2007 07:29 PM
Multiple select drop down poplulating sub drop down scott@dettcom.com Javascript 3 11-09-2006 07:50 PM
Auto Drop down a Drop Down List xxbmichae1@supergambler.com Javascript 5 11-23-2005 01:35 AM
New to .NET, can I have one drop down box control the data of another drop down box using a database? SirPoonga ASP .Net 2 01-07-2005 10:44 PM



Advertisments