Skip to content

Miscellaneous

textFieldTag()

textFieldTag() — returns any

Builds and returns a string containing a text field form control based on the supplied name. Note: Pass any additional arguments like class, rel, and id, and the generated tag will also include those values as HTML attributes.

NameTypeRequiredDefaultDescription
namestringyesName to populate in tag’s name attribute.
valuestringyesValue to populate in tag’s value attribute.
labelstringyesSee documentation for textField.
labelPlacementstringyesaroundSee documentation for textField.
prependstringyesSee documentation for textField.
appendstringyesSee documentation for textField.
prependToLabelstringyesSee documentation for textField.
appendToLabelstringyesSee documentation for textField.
typestringyestextSee documentation for textField.
<!--- Basic usage usually involves a `label`, `name`, and `value` --->
<cfoutput>
    #textFieldTag(label="Search", name="q", value=params.q)#
</cfoutput>