A good debugging technique here is to do this. <cfloop list="#variableNames#" index="items" delimiters = ","> <cfoutput>#items#</cfoutput>
Then you can see if that matches what you see in your form. And you get the error, in your second example, because it doesn't exist in the form scope. Which is why you need to do the strucyKeyExists, but I think you knew that. -- Regards, Andrew Scott WebSite: http://www.andyscott.id.au/ Google+: http://plus.google.com/108193156965451149543 On Thu, Apr 5, 2012 at 1:19 PM, Rob Voyle <[email protected]> wrote: > > Hi Ray > Still no go. > Just to avoid confusuion I changed the index to items so I don't get > confused > with variable scope. > > <cfloop list="#variableNames#" index="items" delimiters = ","> > and then > <cfif structKeyExists(form, items) and form[items] is ""> > doesn't generate any appropriate error messages when an entry is ommitted. > When I just use > <cfif form[items] is ""> > I get the scope error (same if I use variables[items] > > Thanks for you help on this. > > Rob > > On 4 Apr 2012 at 21:56, Raymond Camden wrote: > > > Woah - this is way bad. > > > > On Wed, Apr 4, 2012 at 9:53 PM, Rob Voyle <[email protected]> > > wrote: > > > <cfloop list="#variableNames#" index="variableNames" delimiters = > > ","> > > > > You can't say "use variable x as a list and make an index x too" - > > it > > overwrites the value. If variableNames is your list, you want > > something else for index, like, variable perhaps. > > > > <cfloop list="#variablenames# "index="variable"> > > > > Then you can do > > > > <cfif structKeyExists(forms, variable) and forms[variable] is ""> > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:5847 Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm
