home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1999 April / APC443.iso / features / grpware / coldfus / coldfusi.exe / data1.cab / Documentation / snippets / cfform.cfm < prev    next >
Encoding:
Text File  |  1998-10-08  |  2.3 KB  |  84 lines

  1. <!--- This example shows the use of CFINPUT controls in
  2. a CFFORM --->
  3. <HTML>
  4. <HEAD>
  5.  
  6. <TITLE>
  7. CFFORM Example
  8. </TITLE>
  9. </HEAD>
  10.  
  11. <BODY>
  12. <H3>CFFORM Example</H3>
  13.  
  14. <CFIF IsDefined("form.oncethrough") is "Yes">
  15.     <CFIF IsDefined("form.testVal1") is True>
  16.     <H3>Results of Radio Button Test</H3>
  17.     
  18.         <CFIF form.testVal1 is "Yes">Your radio button answer was yes</CFIF>
  19.         <CFIF form.testVal1 is "No">Your radio button answer was no</CFIF>
  20.     </CFIF>
  21.     
  22.     <CFIF IsDefined("form.chkTest2") is True>
  23.     <H3>Results of Checkbox Test</H3>
  24.         Your checkbox answer was yes
  25.     <CFELSE>
  26.         <H3>Results of Checkbox Test</H3>
  27.         Your checkbox answer was no
  28.     </CFIF>
  29.  
  30.     <CFIF IsDefined("form.textSample") is True AND form.textSample is not "">
  31.     <H3>Results of Credit Card Input</H3>
  32.         Your credit card number, <CFOUTPUT>#form.textSample#</CFOUTPUT>, was 
  33.         valid under the MOD 10 algorithm.
  34.     </CFIF>
  35.     
  36.     <CFIF IsDefined("form.sampleSlider") is "True">
  37.     <H3>You gave this page a rating of <CFOUTPUT>#form.sampleSlider#</CFOUTPUT></H3>    
  38.     </CFIF>
  39.     <hr noshade>
  40. </CFIF>
  41. <!--- begin by calling the cfform tag --->
  42. <CFFORM ACTION="cfform.cfm" METHOD="POST" ENABLECAB="Yes">
  43. <TABLE>
  44. <TR>
  45.     <TD>
  46.     <H4>This example displays the radio button input type
  47.     for CFINPUT.</H4>
  48.     Yes <CFINPUT TYPE="Radio" NAME="TestVal1" VALUE="Yes" CHECKED="yes">
  49.     No <CFINPUT TYPE="Radio" NAME="TestVal1" VALUE="No">
  50.     </TD>
  51. </TR>
  52. <TR>
  53.     <TD>
  54.     <H4>This example displays the checkbox input type for CFINPUT.</H4>
  55.     <CFINPUT TYPE="Checkbox" NAME="ChkTest2" VALUE="Yes">
  56.     </TD>
  57. </TR>
  58.  
  59. <TR>
  60.     <TD>
  61.     <H4>This example shows a client-side validation for
  62.     CFINPUT text boxes.</H4>
  63.     <BR>(<I>This item is optional</I>)<BR>
  64.     Please enter a credit card number:
  65.     <CFINPUT TYPE="Text" NAME="TextSample" MESSAGE="Please enter a Credit Card Number" VALIDATE="creditcard" REQUIRED="No">
  66.     </TD>
  67. </TR>
  68.  
  69. <TR>
  70.     <TD>
  71.     <H4>This example shows the use of the CFSLIDER tag.</H4>
  72.     <P>Rate your approval of this example from 1 to 10 by sliding the control.
  73.     <P>1 <CFSLIDER NAME="sampleSlider" LABEL="Sample Slider" RANGE="1,10" MESSAGE="Please enter a value from 1 to 10" SCALE="1" BOLD="No" ITALIC="No" REFRESHLABEL="No"> 10
  74.     </TD>
  75. </TR>
  76. </TABLE>
  77.  
  78. <P><INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="show me the result">
  79. <INPUT TYPE="Hidden" NAME="oncethrough" VALUE="yes">
  80. </CFFORM>
  81.  
  82. </BODY>
  83. </HTML>       
  84.