How to disable date range of a Calendar in ColdFusion

cfcalendar - disable date range

cfcalendarStartRangeEndRange.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfcalendar tag: how to disable date range (startRange, endrange) in calendar in coldfusion</title>
</head>

<body>
<h2 style="color:OliveDrab; font-style:italic">cfcalendar tag example: how to use startrange, endrange attribute</h2>
<hr width="625" align="left" color="Olive" />
<br />

<cfif IsDefined("Form.SubmitClassDate")>
 <cfoutput>
  <h3 style="color:DarkSeaGreen;">
      Next Class Date Is: #DateFormat(Form.ClassDate)#
  </h3>
    </cfoutput>
</cfif>

<cfform name="CalendarStartRangeEndRangeTest" method="post" format="html">
 <table border="1" cellpadding="5" cellspacing="0" bordercolor="Olive">
     <tr>
         <td colspan="2" bgcolor="OliveDrab" style="color:Snow; font-size:large" align="center">
             Next Class Date Submit Form
            </td>
        </tr>
     <tr valign="top">
         <td style="color:OliveDrab; font-weight:bold">
             Next Class Date
            </td>
         <td >
             <cfcalendar 
                 name="ClassDate" 
                    startrange="#Now()#"
                    endrange="#DateAdd('d',4,Now())#"
                     />
            </td>
        </tr>
     <tr>
         <td colspan="2" align="right">
       <cfinput 
                 name="SubmitClassDate" 
                    type="submit" 
                    value="Submit Date"
                    style="height:45px; width:150px; font-size:large; font-style:italic; font-weight:bold; color:OliveDrab;"
                    >
            </td>
        </tr>
    </table>
</cfform>

</body>
</html>













More ColdFusion examples