Skip to main content
Known Participant
January 5, 2007
Question

cfif

  • January 5, 2007
  • 2 replies
  • 434 views
Hi i have the following cfif,

<cfif IsDefined("form.EXH_Program_#currRow#")>

i need to change it to
<cfif ("form.EXH_Program_#currRow#") EQ "X">

but this is not working any ideas why?
This topic has been closed for replies.

2 replies

Inspiring
January 5, 2007
Also, if you need to do the same thing for variables not in a collection (i.e. the form collection in this case), you can always use the Evaluate() function:

e.g.
Evaluate("form.EXH_Program_#currRow#")
or
Evaluate("form.EXH_Program_" & currRow)
Inspiring
January 5, 2007
quote:

Originally posted by: insuractive
Also, if you need to do the same thing for variables not in a collection (i.e. the form collection in this case), you can always use the Evaluate() function:
e.g.
Evaluate("form.EXH_Program_#currRow#")
or
Evaluate("form.EXH_Program_" & currRow)

True, but, using array notation as per Adam's post is more efficient.
Inspiring
January 5, 2007
> <cfif ("form.EXH_Program_#currRow#") EQ "X">
>
> but this is not working any ideas why?

Well the string "form.EXH_Program_#currRow#" (which is what it is: just a
string) will never equal "x" will it?

You probably mean:
form["EXH_Program_#currRow#"] eq "x"

--
Adam