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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LOOP and DROP DOWN LIST

Status
Not open for further replies.

ITGL72

MIS
Joined
Jul 2, 2001
Messages
105
Location
US
I'm looking to do a CFLOOP for a DROPDOWN MENU on a webpage. Again looping is really a weka point for me. I have a list of categories in a table. I want to do a CFLOOP to display all the categories in the drop down list on the webpage.

I can get the query going:

<CFQUERY NAME=&quot;CATZ&quot; DATASOURCE=&quot;GLKB&quot;>
Select CATID, CATEGORY
From CATEGORIES
Order By CATEGORY
</CFQUERY>


and I can get the select list going:

<select name=&quot;CATEGORY&quot;>
<option value=&quot;test1&quot;>test1</option>
</select>



I just need to see a way to populate the categories into the select drop down menu dynamically.

Thanks for the help!


 
<select name=&quot;CATEGORY&quot;>
<cfoutput query=&quot;CATZ&quot;>
<option value=&quot;#CATID#&quot;>#CATEGORY#</option>
</cfoutput>
</select>
Sylvano
dsylvano@hotmail.com
 
I thought there was a CFLOOP - Silly me! LOL (DARN NON-PROGRAMER)
 
There is a cfloop but you don't need it in this case, it'd be pointless to use.. just use WebSpider's code...
 
I'm down with the easiest code available. Enjoy your weekend folks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top