Jump to content
Sign in to follow this  
newoscfan

STS + dynamic drop-down lists

Recommended Posts

I've read and searched through the STS forums, but have not seen anything about creating dynamic drop-down search boxes with STS.

 

I know how to approach this conceptually, but I don't know how to implement it using OSC and STS, so I'm turning to you experts for help...

 

...I'd like to use OSC + STS to set up an online wine store, where the user can select the year, country and grape variety from dynamic drop-down lists and then click on a search/submit button to search for any matching wines I may have in stock.

 

These drop-down boxes should be located in the header, which will be common to all pages and populated from a new table in mysql, created with something like:

 

CREATE TABLE `table_wine` (

`wine_id` VARCHAR(10),

`wine_year` VARCHAR(4),

`wine_country` VARCHAR(30),

`winery_name` VARCHAR(30),

`grape_variety` VARCHAR(30),

`bottle_quantity` VARCHAR(4),

`wine_description` VARCHAR(30),

PRIMARY KEY (wine_id)

}

 

The first drop-down list (year) should have a default value of "Year" and be populated by all the years in my new db table (`table_wine`).

 

The second and third drop-down lists (country and grape variety) should be disabled until the user selects an actual year value from the first drop-down (other than the default "Year").

 

We can have an onSubmit() for the first drop-down box, so that when the user selects an actual year, then that year information is sent back to the server, where we can run a db query for all the wines in that year to populate the second and third drop-down boxes, before redisplaying the same page to the user so he/she can search for wines.

 

In other words, after selecting the "year", the page is automatically reloaded with the second and third drop-down lists populated with "country" and "grape variety" information for the selected year, so that the user can select one from each drop-down box before clicking on the search/submit button to search for wines that match that criteria.

 

Can anyone please give me some orientation on how I should implement this?

 

Thank you,

 

SR

Share this post


Link to post
Share on other sites
I've read and searched through the STS forums, but have not seen anything about creating dynamic drop-down search boxes with STS.

 

I know how to approach this conceptually, but I don't know how to implement it using OSC and STS, so I'm turning to you experts for help...

 

...I'd like to use OSC + STS to set up an online wine store, where the user can select the year, country and grape variety from dynamic drop-down lists and then click on a search/submit button to search for any matching wines I may have in stock.

 

These drop-down boxes should be located in the header, which will be common to all pages and populated from a new table in mysql, created with something like:

 

CREATE TABLE `table_wine` (

`wine_id` VARCHAR(10),

`wine_year` VARCHAR(4),

`wine_country` VARCHAR(30),

`winery_name` VARCHAR(30),

`grape_variety` VARCHAR(30),

`bottle_quantity` VARCHAR(4),

`wine_description` VARCHAR(30),

PRIMARY KEY (wine_id)

}

 

The first drop-down list (year) should have a default value of "Year" and be populated by all the years in my new db table (`table_wine`).

 

The second and third drop-down lists (country and grape variety) should be disabled until the user selects an actual year value from the first drop-down (other than the default "Year").

 

We can have an onSubmit() for the first drop-down box, so that when the user selects an actual year, then that year information is sent back to the server, where we can run a db query for all the wines in that year to populate the second and third drop-down boxes, before redisplaying the same page to the user so he/she can search for wines.

 

In other words, after selecting the "year", the page is automatically reloaded with the second and third drop-down lists populated with "country" and "grape variety" information for the selected year, so that the user can select one from each drop-down box before clicking on the search/submit button to search for wines that match that criteria.

 

Can anyone please give me some orientation on how I should implement this?

 

Thank you,

 

SR

 

This is what you are looking for:

http://www.oscommerce.com/community/contri...earch,drop+down

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×