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

isDefined problem

Status
Not open for further replies.

mrsbean

Technical User
Jul 14, 2004
203
0
0
US
I have a series of form variables which can be submitted from the previous page. If the user clicked the delete option for photograph number 1, I will have delete_pic1. The user may have checked that they wanted to delete several photos or no photos. The following code does not work. It won't allow me to put the variable #countPics# in the IsDefined function. ColdFusion gives me an error because it finds the # in the middle of it.

Previously, a photo album was limited to 40 photos. Each and every possibility was given from 1 to 40. I want to compact the code so that I have one statement like the one below.

Can anybody get me thinking in the right zone?

Code:
<cfif  IsDefined(delete_pic#countPics#)>
		<cfset #file_type# = "_#countPics#.jpg">
		<cfinclude template="pa_photo_delete.cfm">
		<cfset #pictures_list# = #ListSetAt(pictures_list, #countPics#," ")#>
		<cfset #captions_list# = #listSetAt(captions_list, #countPics#," ")#>
	<cfelseif IsDefined(caption_#countPics#)>

MrsBean
 
Your IsDefined() function needs quotes, try:
Code:
<cfif  IsDefined("delete_pic#countPics#")>

Hope This Helps!

ECAR
ECAR Technologies

"My work is a game, a very serious game." - M.C. Escher
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top