House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home / Groups / ColdFusion Talk (CF-Talk)

Why is ColdFusion giving me grief over this code?

Author:
Gerald Guido
05/29/2008 12:26 PM

I have a function that does that. It is pretty old so don't make fun of me..... but it works ;) http://pastebin.com/m6d287cb5 On Thu, May 29, 2008 at 12:14 PM, Loathe <timothy.heald@gmail.com> wrote: > Steve Nelson had a tag formurl2attributes.cfm > > I can't seem to find it for download though. > > Charlie Griefer wrote: > > On Thu, May 29, 2008 at 8:57 AM, Rick Faircloth > > <Rick@whitestonemedia.com> wrote: > >> ? > >> > >> <cfif isdefined('url.property_type')> > >>   <cfswitch expression='#url.property_type#'> > >> <cfelse> > >>   <cfswitch expression='#form.property_type#'> > >> </cfif> > >> > >> It's complaining with this error: > >> > >> Context validation error for the cfelse tag. > >> The tag must be nested inside a CFIF tag. > >> > >> Can cfswitch tags not be nested inside cfif tags? > > > > not like that, no.  you need to finish the switch inside of each > condition. > > > > would be "better" to do: > > > > <cfif structKeyExists(url, 'property_type')> > >      <cfset variables.property_type = URL.property_type /> > > </cfif> > > <cfif structKeyExists(form, 'property_type')> > >      <cfset variables.property_type = form.property_type /> > > </cfif> > > > > then > > > > <cfswitch expression="#variables.property_type#"> > >      (case statements) > > </cfswitch> > > > > i think there's a custom tag out there that will automagically put > > form/URL vars into an "attributes" scope.  This is how fusebox does it > > by default (and in Model-Glue it's in the 'event')... but I seem to > > recall a custom tag that would accomplish the same end for folks who > > aren't using a framework. > > > > > >


Search cf-talk

June 19, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
             1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30             

Designer, Developer and mobile workflow conference