Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

drop down populated from database...pls help

Status
Not open for further replies.

terror

Programmer
Aug 22, 2001
86
US
Hi,

I would like to populate a drop down menu from my access database. I assume I do this with both asp and javascript. I need to retrieve 3 fields from my database for shirt sizes and depending upon wether we have that size, it would be added to a drop down list on my html page. Can anyone give me sample code or tell me where I might find a tutorial on this?

much obliged,
Terror
(I've been doing research but can't find what I need to know. My scripting isn't that great....I've been away from it too long)
 
If you want the page to be dynamic (i.e your visitor selects the shirt they want and THEN the dropdown is populated), then you need to pull all the data from the database when the page loads, put that data into javascript arrays, and then load the appropriate array in to the dropdown dynamically.

If you want the shirt selection to be on page1, and then the dropdown is on page2, that could be a simple ASP solution because you only need to hit the database once, and you could script the ASP to create the dropdown as well.

Please explain which solution you would be interested in. That way we can focus on the best approach for you. Einstein47
(Love is like PI - natural, irrational, endless, and very important.)
 
the second approach is what I'm looking for,
example:
user clicks on a band name and is brought to a page that lists all the shirts from that band.
user chooses one of the shirts and is brought to a page with a picture of the shirt and a dropdown that shows what sizes are available (retrieving the sizes from the database)
Thankyou so much for your swift response...I've got everything working but this. It is holding me up.[morning]
-Terror
 
Einstein47...please...if you are around. Can you show me how to script the ASP to create the dropdown?
if you need, I will put up the code I have if you want. It's done with asp and javascript (I think I'm confused because I usually work in vbScript and I'm working with someone else on this and its all javascript, which I am not all that familiar with.
thanks
-Terror
 
This isn't using javascript but it may answer some questions
thread329-260137 provide tools to let people become their best.
 
thanks Onpnt, I'll check it out.
cheers
-Terror
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top