I'm having one of those moments where something seemingly trivial isn't working. I'm sure I'm missing something obvious. I have a custom tag that takes and attribute named "year" and outputs the number of years since then. So, my test.cfm looks like this:
<cf_yearsSince year="1970"> I'd expect that to output "41". I tried to be smart though and put code in the custom tag to detect whether year was passed in and if not, output an error. It didn't work and it boils down to my use of IsDefined on the attribute. Here's the current code for the tag: <cfdump var="#ATTRIBUTES#"> <cfif isDefined(ATTRIBUTES.year)>year is defined<cfelse>year is NOT Defined</cfif> <cfoutput>#year(now()) - ATTRIBUTES.year#</cfoutput> When you run it, the cfdump line shows that the attributes scope contains a value named "YEAR". The 2nd line though says that year is NOT defined. But the 3rd line works anyway. So, what am I doing wrong in the 2nd line re testing that the attribute exists? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:341617 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm