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

lists and checkboxes

Status
Not open for further replies.

jgroove

Programmer
Jul 9, 2001
43
US
I have quite a few of checkboxes on a form, and am having trouble rechecking them when I repopulate the form. here is some of the code I am using:

<input type=&quot;checkbox&quot; value=&quot;Administrators/Supervisors&quot; name=&quot;TARGET_AUDIENCE&quot; <cfif IsDefined(&quot;url.COURESID&quot;) and ListFind(&quot;<cfoutput>#TARGET_AUDIENCE#</cfouput>&quot;,&quot;Administrators/Supervisors&quot;)>CHECKED</cfif>>Administrators/Supervisors

<input type=&quot;checkbox&quot; name=&quot;TARGET_AUDIENCE&quot; value=&quot;Parents&quot; <cfif IsDefined(&quot;url.COURESID&quot;) and ListFind(&quot;<cfoutput>#TARGET_AUDIENCE#</cfouput>&quot;,&quot;Parents&quot;)>CHECKED</cfif>>Parents

<input type=&quot;checkbox&quot; name=&quot;TARGET_AUDIENCE&quot; value=&quot;Counselors&quot;<cfif IsDefined(&quot;url.COURESID&quot;) and ListFind(&quot;<cfoutput>#TARGET_AUDIENCE#</cfouput>&quot;,&quot;Counselors&quot;)>CHECKED</cfif>>Counselors



I look in the dbase and TARGET_AUDIENCE is a comma delimited list. ie Administrators/Supervisors,Parents,Counselors

and I tried some debugging code at the bottom of the page:

<cfif IsDefined(&quot;url.COURSEID&quot;)>
<cfoutput>#TARGET_AUDIENCE#</cfoutput>
<cfset temp=ListFindNoCase(&quot;<cfoutput>#TARGET_AUDIENCE#</cfouput>&quot;,&quot;Parents&quot;)><cfoutput>#temp#</cfoutput></cfif>

output:

Administrators/Supervisors,Parents,Counselors 2


I am at a loss, any ideas?

 
Try to use ListFind function without output tags; you also don't need # sign when variable is used inside cf tags

<cfset temp=ListFindNoCase(TARGET_AUDIENCE,&quot;Parents&quot;)> Sylvano
dsylvano@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top