Refreshing HTML SELECT OPTIONS after populating/selecting another field on the page
I have a number of SELECT statements which allow me to choose from OPTIONS created with ASP and an SQL Select on an (Access) database. I want to make subsequent SELECT's dependant on options selected from previous fields, and to populate these with the results of further SQL select statements. This is like the REQUERY facility within Access.
I can use onChange to execute a JAVA function held within the header block but cannot access SQL with this ... or can I ?
Any ideas ?
Thanks Dave .... I will look into the first option ... if you know where I might be able to find an example perhaps you could let me know. Cheers.
Is this the kind of thing you are looking to do ??
As you change the selections, the fields to the right change accordingly - is that what you wanted ??
By all means look at (and rip off !) the source code.
Basically what I did here was to query the database and return all of the values.
Heres the messy bit - the arrays are unknown at development time - IE I dont know how many Contact Types there will be, and for each Contact Type how many Countries there will be, and for each Country, how many Cities there will be.
So, the JS functions create dynamically named arrays (yuck - a nightmare to document and debug !)
The arrays are then used to populate the <option> tags of the 3 <selects>; and I use onChange to re-populate the <option> tags of the successive <select> tags.
Not pretty, but it does work - and I'm pretty pleased with it. If you want to know more about this, let me know.
Thanks Nathan .... this is just what I need. I will give it a go.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)