|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Adding "All" to a Dynamic Dropdown list
We utilize a form to search for policies in a database. There is a free text along with subcatagories under the heading of "Services". I'm having a problem including an "All" process to enable searching through all services. Here is the code we are using:
<CFQUERY NAME="GetService" DATASOURCE="Policies"> SELECT Service FROM TblService </CFQUERY> <b>Policy Search Form</b> <form action="PolicyAction.cfm" method="post"> Title Key Word: <input type="text" name="PolicyTitle" value=""> <tr>Service: <select name="Service"> <cfoutput query="GetService"> <option value="#Service#">#GetService.Service#</cfoutput> </select><br></tr> <input type="submit" name="Submit"> </form> |
|
#2
|
|||
|
|||
|
Hi,
If i understood correctly, you want to have an "All" option in your dropdown which sould search for all in your form submit. I would do some thing like this. <tr>Service: <select name="Service"> <option value="ALL">-- All -- </option> <cfoutput query="GetService"> <option value="#Service#">#GetService.Service#</cfoutput> </select><br></tr> and then on your form submit you would check if the service value is all then search for all in your query. ------------------------------------------------------------------- Quote:
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > Cold Fusion Development > Adding "All" to a Dynamic Dropdown list |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|