![]() |
![]() |
||||||
|
|||||||
| Tags: dropdown, dynamic |
![]() |
|
|||
|
I can't test this because I don't have a server running. But I do want to know
if this will work. I'm trying to populate a dropdown based on another dropdown's value... <select name="test_select"> <option selected value=""></option> <option value="bill">bill</option> <option value="john">john</option> <option value="andy">andy</option> </select> <cfif IsDefined(#form.test_select#)> <cfquery name="test_select" datasource="mydsn" maxrows="25"> SELECT id,first_name,last_name FROM my_db WHERE first_name = '#test_select#' </cfquery> <select name="first_name"> <cfoutput query="test_select"> <option value="#id#">#first_name# #last_name#</option> </cfoutput> </select> </cfif> |
| Sponsored Links |
|
|||
|
Maybe I'm wrong on the arrays...
Last time I did the local project the setup was something like Field 1 Field 2(1)(1) Field 2(1)(2) Field 2(1)(3) But anyway. I'd say on average each state has about 30-40 rivers I have stored. Some states are far less and some are far more. Wisconsin for example has about 100 records. |
|
|||
|
For that many records you may want to go page to page. The user picks a state
on page 1 and the available rivers come up on page 2. Make sure you test with Wisconsin to see what the most user freindly way is to present 100 river names. I'm guessing you won't put them in a drop down. |
|
|||
|
idesdema wrote:
> Yeah I was trying to get around that but that may be the way I go. Really I > want to do an ajax solution but every recommendation has been to get jquery and > learn json and yatta yatta. I am pretty lazy. > There is also CFAJAX and CFCAJAX that predate CF8 and work well. You may want to also consider an 'auto suggest' feature that filters a list as a user types the first few letters. But that depends on what the goal of the user is. Do they know the name of the river they want to select or are many going to be browsing them all. |
|
|||
|
I have already decided. I don't want to do auto suggest because the value has
to be exact. Unfortunately for the user, they are going to get 100 options like it or not. I will be using auto suggest for search but not for this. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise