Set Credit Card Years Forever

<cfparam name="fromYear" default="#DateFormat(Now(),"yyyy")#">
<cfset toYear= fromYear + 5>

<select name="cardYear">
    <option value=
"0" <cfif fromYear eq "0">selected</cfif>>
Select Year</option>
    <cfoutput>
    <cfloop index="year" from="#DateFormat(Now(),"yyyy")#" to="#toYear#" step="+1">
        <option value="#year#" <cfif fromYear eq year>selected</cfif>>#year#</option>
    </cfloop>
    </cfoutput>
</select>

About This Tutorial
Author: Carlos Batista
Skill Level: Beginner 
 
 
 
Platforms Tested: CFMX7
Total Views: 23,919
Submission Date: May 14, 2007
Last Update Date: June 05, 2009
All Tutorials By This Autor: 1
Discuss This Tutorial
  • my gran could write a better tip than this. She has never even heard of Coldfusion. perl rocks! could you spam me please.

  • You could even simplify the 'thisYear' with #year(now())#

  • An Addition Start: Expiry:

Advertisement

Sponsored By...
Powered By...