Chapter 1: ColdFusion Tags
111
If you specify a value in quotation marks, you must escape the quotation marks by
doubling them, for example,
PASSTHROUGH= "readonly= " "YES " " "
Example
<!--- This example shows the use of CFINPUT to validate input --->
<HTML>
<HEAD>
<TITLE>
CFINPUT Example
</TITLE>
</HEAD>
<BODY bgcolor=silver>
<H3>CFINPUT Example</H3>
<!--- this example shows the use of CFINPUT within a CFFORM to
ensure simple validation of text items --->
<CFFORM ACTION="cfinput.cfm" METHOD="POST" ENABLECAB="Yes">
<!--- phone number validation --->
Phone Number Validation (enter a properly formatted phone number):
<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>
<!--- zip code validation --->
<P>Zip Code Validation (enter a properly formatted zip code):
<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>
<!--- range validation --->
<P>Range Validation (enter an integer from 1 to 5):
<BR><CFINPUT TYPE="Text" NAME="MyRange" RANGE="1,5" MESSAGE="You must
enter an integer from 1 to 5" VALIDATE="integer" REQUIRED="No">
<!--- date validation --->
<P>Date Validation (enter a properly formatted date):
<BR><CFINPUT TYPE="Text" NAME="MyDate" MESSAGE="Please enter a correctly
formatted date (dd/mm/yy)" VALIDATE="date" REQUIRED="No">
<INPUT TYPE="Submit" NAME="" VALUE="send my information">
</CFFORM>
</BODY>
</HTML>
Summary of Contents for COLDFUSION 4.5-CFML LANGUAGE
Page 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Page 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Page 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Page 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Page 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Page 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Page 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Page 584: ...560 CFMLLanguageReference...
Page 594: ...570 CFMLLanguageReference...