Lets you place a single-line text entry box in a cfform
. The tag also gives you control over font characteristics.
<cftextinput name = "name" value = "text" required = "Yes" or "No" range = "min_value, max_value" validate = "data_type" onValidate = "script_name" message = "text" onError = "text" size = "integer" font = "font_name" fontSize = "integer" italic = "Yes" or "No" bold = "Yes" or "No" height = "integer" width = "integer" vSpace = "integer" hSpace = "integer" align = "alignment" bgColor = "color" textColor = "color" maxLength = "integer" notSupported = "text">
cfapplet,
cfinput,
cfform,
cfselect,
cfgrid,
cfslider,
cfgridcolumn,
cfgridrow,
cftree,
cfgridupdate,
cftreeitem
Note
|
<!--- This example shows the use of cftextinput ---> <html> <head> <title> cftextinput Example </title> </head> <body bgcolor = silver> <H3>cftextinput Example</H3> cftextinput can be used to provide simple validation for text fields in cfform and to have control over font information displayed in cfform input boxes for text. For example, the field provided below must not be blank, and provides a client-side message upon erring. <cfform action = "cftextinput.cfm" method = "POST" enableCAB = "Yes"> <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> </body> </html>