Re: Dynamic variable Name in cfif
I'm having no trouble setting and outputting a dynamic variable name: cfoutputExpires_#UpdateMe#= #form[ 'Expires_' UpdateMe]#/cfoutput but when I go to evaluate that variable: cfif form[ 'Expires_' UpdateMe ] EQ Yes it returns: Variable YES is undefined because the VALUE of the Variable named Expires7 is indeed YES. Without quotes around Yes, CF sees it as a variable name, not a literal string. Dave Watts, CTO, Fig Leaf Software 1-202-527-9569 http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358902 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Dynamic variable Name in cfif
Also, shouldn't it be cfif form[ 'Expires_' UpdateMe ] is 'Yes' ??? or is it the current trend to use EQ when checking a text field nowadays? :) On Fri, Jul 18, 2014 at 6:22 AM, Dave Watts dwa...@figleaf.com wrote: I'm having no trouble setting and outputting a dynamic variable name: cfoutputExpires_#UpdateMe#= #form[ 'Expires_' UpdateMe]#/cfoutput but when I go to evaluate that variable: cfif form[ 'Expires_' UpdateMe ] EQ Yes it returns: Variable YES is undefined because the VALUE of the Variable named Expires7 is indeed YES. Without quotes around Yes, CF sees it as a variable name, not a literal string. Dave Watts, CTO, Fig Leaf Software 1-202-527-9569 http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358912 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Dynamic variable Name in cfif
Also, shouldn't it be cfif form[ 'Expires_' UpdateMe ] is 'Yes' ??? or is it the current trend to use EQ when checking a text field nowadays? :) They're equivalent, so it doesn't matter which one you use. It's purely a matter of personal preference. Dave Watts, CTO, Fig Leaf Software 1-202-527-9569 http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358913 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm