Whatever message this page gives is out now! Go check it out!
<input type="text" name="StartDate" size="16" maxlength="16"><br>
<input type="hidden" name="StartDate_required"
value="You must enter a start date.">
<input type="hidden" name="StartDate_date"
value="Please enter a valid date as the start date.">Field name suffix | Verifies |
_integer, _cfforminteger | An integer of the range -2,147,483,648 -2,147,483,647. Treats the initial characters "$ ¤ ¥ £ +” as valid input, but removes them from the number. |
_cfformnumeric | Any numeric value. Treats the initial characters "$ ¤ ¥ £ +” as valid input, but does NOT remove them from the number. |
_float, _cfformfloat | Any value (including an integer) that can be represented as a floating point number with up to 12 significant digits. Treats the initial characters "$ ¤ ¥ £ +” as valid input, but removes them from the number. Converts input data to a real number; for example a dump of an integer value on the action page includes a decimal point followed by a 0. |
_range, _cfformrange | A numeric value within boundaries specified by the value attribute. Specify the range in the value attribute using the format "min=minvalue max=maxvalue." You cannot specify a custom error message for this validation. |
_date, _cfformdate | A date in any format that ColdFusion can understand; converts the input to ODBC date format. Allows entry of a time part, but removes it from the ODBC value. |
_cfformusdate | A date in the form m/d/y, m-d-y , or m.d.y, The m and d format can be 1 or 2 digits; y can be 2 or 4 digits. Does not convert the string to an ODBC value and does not allow a time part. |
_eurodate, _cfformeurodate | A date in the form d/m/y, d-m-y, or d.m.y. The m and d format can be 1 or 2 digits; y can be 2 or 4 digits. Converts the input to ODBC date format. Allows entry of a time part, but removes it from the ODBC value. |
_time, _cfformtime | A time. Can be in 12-hour or 24-hour clock format, and can include seconds in the form hh:mm:ss or a case-independent am or pm indicator.Converts the input to ODBC time format. Allows entry of a date part, but removes it from the ODBC value. |
_cfformcreditcard | After stripping blanks and dashes, a number that conforms to the mod10 algorithm. Number must have 13-16 digits. |
_cfformSSN, _cfformsocial_security_number | A nine-digit Social Security number. Can be of the form xxx-xx-xxxx or xxx xx xxxx. |
_cfformtelephone | Standard U.S. telephone formats. Does not support international telephone numbers.Allows area codes with or without parentheses, and hyphens (-), spaces, periods, or no separators between standard number groups. Can be preceded by a 1 long-distance designator, and can end with an up-to-5 digit extension, optionally starting with x. The area code and exchange must begin with a digit in the range 1 - 9. |
_cfformzipcode | A 5-digit or 9-digit U.S. ZIP code. In 9-digit codes, precede the final four digits by a hyphen (-) or space. |
_cfformemail | A valid e-mail address. Valid address characters are a-zA-Z0-9_- and the period and separator. There must be a single at sign (@) and the text after the @ character must include a period, as in my_address@MyCo.com or b-b.jones27@hisco.co.uk. |
_cfformURL | A valid URL. Must start with http: , https:\, ftp:\, , mailto:, or news:. Can include, as appropriate, user name and password designators and query strings. The main part of the address can only have the characters A-Za-z0-9 and -. |
_cfformboolean | A value that can be treated as a Boolean: Yes, No, True, False, 0, 1. |
_cfformUUID | A universally unique identifier (UUID) that follows the ColdFusion format, xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx, where x is a hexadecimal number. |
_cfformGUID | A unique identifier that follows the Microsoft/DCE format, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, where x is a hexadecimal number. |
_cfformnoblanks | The field must not include blanks. ColdFusion uses this validation only if you also specify a _required hidden field. |
_cfformmaxlength | The number of characters must not exceed the number specified by the tag value attribute. |
_cfformregex, _cfformregular_expression | The data must match a JavaScript regular expression specified by the tag value attribute. |
_required, _cfformrequired | Data must be entered or selected in the form field. |
<html>
<head>
<title>Simple Data Form</title>
</head>
<body>
<h2>Simple Data Form</h2>
<!--- Form part. --->
<form action="datatest.cfm" method="Post">
<input type="hidden"
name="StartDate_cfformrequired"
value="You must enter a start date.">
<input type="hidden"
name="StartDate_cfformdate"
value="Enter a valid date as the start date.">
<input type="hidden"
name="Salary_cfformrequired"
value="You must enter a salary.">
<input type="hidden"
name="Salary_cfformfloat"
value="The salary must be a number.">
Start Date:
<input type="text"
name="StartDate" size="16"
maxlength="16"><br>
Salary:
<input type="text"
name="Salary"
size="10"
maxlength="10"><br>
<input type="reset"
name="ResetForm"
value="Clear Form">
<input type="submit"
name="SubmitForm"
value="Insert Data">
</form>
<br>
<!--- Action part. --->
<cfif isdefined("Form.StartDate")>
<cfoutput>
Start Date is: #DateFormat(Form.StartDate)#<br>
Salary is: #DollarFormat(Form.Salary)#
</cfoutput>
</cfif>
</html>Code | Description | |
| Gathers the information from this form sends it to the dataform.cfm page (this page) using the Post method. | |
<input type="hidden" name="StartDate_cfformrequired" value="You must enter a start date.">
<input type="hidden" name="StartDate_cfformdate" value="Enter a valid date as the start date.">Requires input into the StartDate input field. If there is no input, displays the error information "You must enter a start date." Requires the input to be in a valid date format. If the input is not valid, displays the error information "Enter a valid date as the start date." | ||
<input type="hidden" name="Salary_cfformrequired" value="You must enter a salary.">
<input type="hidden" name="Salary_cfformfloat" value="The salary must be a number.">Requires input into the Salary input field. If there is no input, displays the error information "You must enter a salary." Requires the input to be in a valid number. If it is not valid, displays the error information "The salary must be a number." | ||
| Creates a text box called StartDate in which users can enter their starting date. Makes it 16-characters wide. | |
Salary:
<input type="text" name="Salary" size="10" maxlength="10"><br>Creates a text box called Salary in which users can enter their salary. Makes it ten-characters wide. | ||
<cfif isdefined("Form.StartDate")>
<cfoutput>
Start Date is: #DateFormat(Form.StartDate)#<br>
Salary is: #DollarFormat(Form.Salary)#
</cfoutput>
</cfif>Displays the values of the StartDate and Salary form fields only if they are defined. They are not defined until you submit the form, so they do not appear on the initial form. Uses the DateFormat function to display the start date in the default date format. Uses the DollarFormat function to display the salary with a dollar sign and commas. |