home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / cfinput.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.5 KB  |  40 lines

  1. <!--- This example shows the use of CFINPUT to validate input --->
  2. <HTML>
  3.  
  4. <HEAD>
  5. <TITLE>
  6. CFINPUT Example
  7. </TITLE>
  8. </HEAD>
  9.  
  10. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  11. <BODY  bgcolor="#FFFFD5">
  12.  
  13. <H3>CFINPUT Example</H3>
  14.  
  15. <!--- this example shows the use of CFINPUT within a CFFORM to
  16. ensure simple validation of text items --->
  17. <CFFORM ACTION="cfinput.cfm" METHOD="POST" ENABLECAB="Yes">
  18.  
  19. <!--- phone number validation --->
  20. Phone Number Validation (enter a properly formatted phone number):
  21. <BR><CFINPUT TYPE="Text" NAME="MyPhone" MESSAGE="Please enter telephone number, formatted xxx-xxx-xxxx (e.g. 617-761-2000)" VALIDATE="telephone" REQUIRED="Yes"><font size=-1 color=red>Required</FONT>
  22. <!--- zip code validation --->
  23. <P>Zip Code Validation (enter a properly formatted zip code):
  24. <BR><CFINPUT TYPE="Text" NAME="MyZip" MESSAGE="Please enter zip code, formatted xxxxx or xxxxx-xxxx" VALIDATE="zipcode" REQUIRED="Yes"><font size=-1 color=red>Required</FONT>
  25. <!--- range validation --->
  26. <P>Range Validation (enter an integer from 1 to 5):
  27. <BR><CFINPUT TYPE="Text" NAME="MyRange" RANGE="1,5" MESSAGE="You must enter an integer from 1 to 5" VALIDATE="integer" REQUIRED="No">
  28. <!--- date validation --->
  29. <P>Date Validation (enter a properly formatted date):
  30. <BR><CFINPUT TYPE="Text" NAME="MyDate" MESSAGE="Please enter a correctly formatted date (dd/mm/yy)" VALIDATE="date" REQUIRED="No">
  31.  
  32. <INPUT TYPE="Submit" NAME="" VALUE="send my information">
  33.  
  34. </CFFORM>
  35.  
  36.  
  37. </BODY>
  38.  
  39. </HTML>       
  40.