| Contents > Developing ColdFusion MX Applications > Building Dynamic Forms > Input validation with cfform controls |
|
|
|
|
||
The cfinput and cftextinput tags include the validate attributes, which lets you specify a valid data entry type for the control. You can validate user entries on the following data types:
Data type |
Description |
|---|---|
Date |
Verifies US date entry in the form mm/dd/yyyy (where the year can have one through four digits). |
Eurodate |
Verifies valid European date entry in the form dd/mm/yyyy (where the year can have one through four digits). |
Time |
Verifies a time entry in the form hh:mm:ss. |
Float |
Verifies a floating point entry. |
Integer |
Verifies an integer entry. |
Telephone |
Verifies a telephone entry. You must enter telephone data as ###-###-####. You can replace the hyphen separator (-) with a blank. The area code and exchange must begin with a digit between 1 and 9. |
Zipcode |
(U.S. formats only) Number can be a five-digit or nine-digit zip in the form #####-####. You can replace the hyphen separator (-) with a blank. |
Creditcard |
Blanks and dashes are stripped and the number is verified using the mod10 algorithm. |
Social_security_number |
You must enter the number as ###-##-####. You can replace the hyphen separator (-) with a blank. |
Regular_expression |
Matches the input against a JavaScript regular expression pattern. You must use the |
When you specify an input type in the validate attribute, ColdFusion tests for the specified input type when you submit the form, and submits form data only on a successful match. A successful form submission returns the value True and returns the value False if validation fails.
|
|
||
| Contents > Developing ColdFusion MX Applications > Building Dynamic Forms > Input validation with cfform controls |
|
|
ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting
Version 6.1
Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/dynami37.htm
Comments
Henweigh99 said on Apr 15, 2004 at 12:30 PM :