using drop down boxes to filter data from a database

S

SirPoonga

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?
 
S

SirPoonga

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.
 
Z

Zi

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
 
J

Jeff Cochran

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
 
Z

Ziyad Makki

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top