home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1999 April / APC443.iso / features / grpware / coldfus / coldfusi.exe / data1.cab / Documentation / snippets / cfinput.cfm < prev    next >
Encoding:
Text File  |  1998-10-08  |  1.4 KB  |  39 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. <BODY bgcolor=silver>
  11.  
  12. <H3>CFINPUT Example</H3>
  13.  
  14. <!--- this example shows the use of CFINPUT within a CFFORM to
  15. ensure simple validation of text items --->
  16. <CFFORM ACTION="cfinput.cfm" METHOD="POST" ENABLECAB="Yes">
  17.  
  18. <!--- phone number validation --->
  19. Phone Number Validation (enter a properly formatted phone number):
  20. <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>
  21. <!--- zip code validation --->
  22. <P>Zip Code Validation (enter a properly formatted zip code):
  23. <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>
  24. <!--- range validation --->
  25. <P>Range Validation (enter an integer from 1 to 5):
  26. <BR><CFINPUT TYPE="Text" NAME="MyRange" RANGE="1,5" MESSAGE="You must enter an integer from 1 to 5" VALIDATE="integer" REQUIRED="No">
  27. <!--- date validation --->
  28. <P>Date Validation (enter a properly formatted date):
  29. <BR><CFINPUT TYPE="Text" NAME="MyDate" MESSAGE="Please enter a correctly formatted date (dd/mm/yy)" VALIDATE="date" REQUIRED="No">
  30.  
  31. <INPUT TYPE="Submit" NAME="" VALUE="send my information">
  32.  
  33. </CFFORM>
  34.  
  35.  
  36. </BODY>
  37.  
  38. </HTML>       
  39.