Macromedia coldfusion 4.5-cfml language reference User Manual

Page of 608
Chapter 1:  ColdFusion Tags
61
Example
<!--- This example shows the use of CFINPUT controls in
a CFFORM --->
<HTML>
<HEAD>
<TITLE>
CFFORM Example
</TITLE>
</HEAD>
<BODY>
<H3>CFFORM Example</H3>
<CFIF IsDefined("form.oncethrough") is "Yes">
<CFIF IsDefined("form.testVal1") is True>
<H3>Results of Radio Button Test</H3>
<CFIF form.testVal1 is "Yes">Your radio button answer was yes</CFIF>
<CFIF form.testVal1 is "No">Your radio button answer was no</CFIF>
</CFIF>
<CFIF IsDefined("form.chkTest2") is True>
<H3>Results of Checkbox Test</H3>
Your checkbox answer was yes
<CFELSE>
<H3>Results of Checkbox Test</H3>
Your checkbox answer was no
</CFIF>
<CFIF IsDefined("form.textSample") is True 
 AND form.textSample is not "">
<H3>Results of Credit Card Input</H3>
Your credit card number, <CFOUTPUT>#form.textSample#</CFOUTPUT>, 
was valid under the MOD 10 algorithm.
</CFIF>
<CFIF IsDefined("form.sampleSlider") is "True">
<H3>You gave this page a rating of <CFOUTPUT>#form.sampleSlider#
      </CFOUTPUT></H3>
</CFIF>
<hr noshade>
</CFIF>
<!--- begin by calling the cfform tag --->
<CFFORM ACTION="cfform.cfm" METHOD="POST" ENABLECAB="Yes">
<TABLE>
<TR>
<TD>
<H4>This example displays the radio button input type
for CFINPUT.</H4>
Yes <CFINPUT TYPE="Radio" NAME="TestVal1" VALUE="Yes" CHECKED="yes">
No <CFINPUT TYPE="Radio" NAME="TestVal1" VALUE="No">
</TD>
</TR>
<TR>
<TD>
<H4>This example displays the checkbox input type for CFINPUT.</H4>