I am trying to get the past 5 years from 2011 into a <cfselect> (or select tag) and outout them as options. This is my current solution…
<cfset dtStart = #year(now())# />
<cfset dtToday = dtStart />
<select name="date">
<cfloop index="intDayOffset" from="0" to="4" step="1">
<cfset date = (#dtToday#-#intDayOffset#) />
<cfoutput><option value="#date#">#date#</option></cfoutput>
</cfloop>
</select>
Can anyone come up with a more elegant way to achieve this?
This simplifies it a bit