I remember having a problem like that, I believe that ColdFusion interperts  tag 
nesting before evaluating CFIF and other statements within code.  Which means your 
code must start and end evenly.  It may seem redundant but putting the entire form 
within each of the CFIF brackets I believe is the only way out of this one.

Gregory Harris
Los Angeles ITA Dept.
[EMAIL PROTECTED]

>>> [EMAIL PROTECTED] 07/13 8:39 AM >>>
This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=_2C7475F2.A6C7A9E6
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

There Must be something I don't know about CFIF.  I want to check if a URL =
variable exists.  If it does, I want to add the same variable to the URL =
of the action of a CFForm, basically so I can check for it on the action =
page, and use it to re-route a cflocation. =20

Here's the problem.  I have a CFIF that, if it's true, starts a CFFORM =
with the URL variable included in the action, then it has a CFELSE that =
starts the same form, just without the URL variable.  Problem is, it =
doesn't work.  Tells me that there's an extraneous </CFFORM> at the bottom =
of the template.  Basically, whether or not the criterion is met, it =
doesn't start the form. =20

I musta missed something about CFIF, CFELSE, or CFFORM.  Any Ideas?  =
Here's my logic:



<cfif IsDefined ('URL.myvariable')>
   <cfform action=3D"emp_add_action.cfm?myvariable=3Dtrue" method=3D"post" =
enablecab=3D"Yes">
  <cfelse>
   <cfform action=3D"emp_add_action.cfm" method=3D"POST" enablecab=3D"Yes">=

 </cfif>


Whether myvariable exists or not it doesn't print either of the cfform =
lines.

--=_2C7475F2.A6C7A9E6
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Description: HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" http-equiv=3DContent-Type=
>
<META content=3D"MSHTML 5.00.3013.2600" name=3DGENERATOR></HEAD>
<BODY bgColor=3D#ffffff=20
style=3D"FONT: 10pt Arial; MARGIN-LEFT: 2px; MARGIN-TOP: 2px">
<DIV>There Must&nbsp;be something I don't know about CFIF.&nbsp;&nbsp;I =
want=20
to&nbsp;check if a URL variable exists.&nbsp; If it does, I want to add =
the same=20
variable to the URL of the action of a CFForm, basically so I can check =
for it=20
on the action page, and use it to re-route&nbsp;a cflocation.&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>Here's the problem.&nbsp; I have a CFIF that, if it's true, starts a =
CFFORM=20
with the URL variable included in the action, then it has a CFELSE that =
starts=20
the same form, just without the URL variable.&nbsp; Problem is, it =
doesn't=20
work.&nbsp; Tells me that there's an extraneous &lt;/CFFORM&gt; at the =
bottom of=20
the template.&nbsp; Basically, whether or not the criterion is met, it =
doesn't=20
start the form.&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>I musta missed something about CFIF, CFELSE, or CFFORM.&nbsp; Any=20
Ideas?&nbsp; Here's my logic:</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&lt;cfif IsDefined ('URL.myvariable')&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;cff=
orm=20
action=3D"emp_add_action.cfm?myvariable=3Dtrue" method=3D"post"=20
enablecab=3D"Yes"&gt;<BR>&nbsp;&nbsp;&lt;cfelse&gt;<BR>&nbsp;&nbsp;&nbsp;&l=
t;cfform=20
action=3D"emp_add_action.cfm" method=3D"POST"=20
enablecab=3D"Yes"&gt;<BR>&nbsp;&lt;/cfif&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Whether myvariable exists or not it doesn't print either of the =
cfform=20
lines.</DIV></BODY></HTML>

--=_2C7475F2.A6C7A9E6--
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ 
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebarRsts&bodyRsts/cf_talk or send a message 
to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to