How to use CheckBox in ColdFusion

cfinput - input type checkbox

cfinputTypeCheckBox.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfinput type checkbox: how to use input type checkbox in coldfusion</title>
</head>

<body>
<h2 style="color:SaddleBrown; font-style:italic">cfinput type checkbox example: how to use</h2>
<hr width="425" align="left" color="Gray" />
<br />

<cfif IsDefined("Form.SubmitColors") and IsDefined("Form.Color")>
 <cfoutput>
  <h3 style="color:OrangeRed;">
         You choose: #Form.Color#
  </h3>
    </cfoutput>
</cfif>

<cfform name="InputTypeCheckBoxTest" method="post" format="html">
 <table border="1" cellpadding="5" cellspacing="0" bordercolor="Orange">
     <tr>
         <td colspan="2" bgcolor="DeepPink" style="color:Snow; font-size:large" align="center">
             Favorite Colors?
            </td>
        </tr>
     <tr>
         <td style="color:RosyBrown; font-weight:bold">
             Crimson
            </td>
         <td>
             <cfinput type="checkbox" name="Color" value="Crimson">
            </td>
        </tr>
     <tr>
         <td style="color:RosyBrown; font-weight:bold">
             DodgerBlue
            </td>
         <td>
             <cfinput type="checkbox" name="Color" value="DodgerBlue">
            </td>
        </tr>
     <tr>
         <td style="color:RosyBrown; font-weight:bold">
             SeaGreen
            </td>
         <td>
             <cfinput type="checkbox" name="Color" value="SeaGreen">
            </td>
        </tr>
     <tr>
         <td style="color:RosyBrown; font-weight:bold">
             RosyBrown
            </td>
         <td>
             <cfinput type="checkbox" name="Color" value="RosyBrown">
            </td>
        </tr>
     <tr>
         <td colspan="2" align="right">
       <cfinput name="SubmitColors" type="submit" value="Submit">
            </td>
        </tr>
    </table>
</cfform>
</body>
</html>













More ColdFusion examples