User Guide

cftextinput 337
The cfform action attribute posts to the same page as the form itself (this is the default), or
the action page has a form that contains controls with the same names as corresponding
controls on the user entry form
For more information, see
cfform.
If the
cfform preserveData attribute is "yes", and the form posts back to the same page, the
posted value (not the value of the
value attribute) of the cftextinput control is used.
Example
<h3>cftextinput Example</h3>
cftextinput provides simple validation for text fields in cfform and
control over font information displayed in cfform input boxes
for text. For example, the field below must not be blank, and
provides a client-side message upon erring.
<cfform action = "cftextinput.cfm" method = "post">
<cfif IsDefined("form.myInput")>
<h3>You entered
<cfoutput>
#form.myInput#</cfoutput> into the text box </h3>
</cfif>
<cftextinput name = "myInput"
font = "Courier" fontSize = 12
value = "Look, this text is red!"
textColor = "FF0000"
message = "This field must not be blank"
required = "Yes">
<input type = "Submit" name = "" value = "submit">
</cfform>