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

checkboxes/loop question

Status
Not open for further replies.

Leakyradiator

Technical User
Jul 12, 2002
35
0
0
US
I have query results:


231
232
233
234
235
236
237
238
239

and a list:

233
237
239

I need to put the results of the query into a form with a checkbox in front of each. If the query number equals the list number, I need to have the box checked.

I've tried using the query with a loop on the list, but it, in the case above it'd give me the whole list three times with the one checked item in each complete list.

Thanks


 
<cfset mylist="233,237,239">

<cfoutput query="myQry">
<input type="checkbox" name="Items" value="#id#"
<Cfif listfind(mylist,id)> checked</cfif>> #id#<br><br>
</cfoutput>

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top