Miscellaneous
fileField()
Signature
Section titled “Signature”fileField() — returns any
Description
Section titled “Description”Builds and returns a string containing a file field form control based on the supplied objectName and property. Note: Pass any additional arguments like class, rel, and id, and the generated tag will also include those values as HTML attributes.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
objectName | any | yes | — | See documentation for textField. |
property | string | yes | — | See documentation for textField. |
association | string | yes | — | See documentation for textfield. |
position | string | yes | — | See documentation for textfield. |
label | string | yes | useDefaultLabel | See documentation for textField. |
labelPlacement | string | yes | around | See documentation for textField. |
prepend | string | yes | — | See documentation for textField. |
append | string | yes | — | See documentation for textField. |
prependToLabel | string | yes | — | See documentation for textField. |
appendToLabel | string | yes | — | See documentation for textField. |
errorElement | string | yes | span | See documentation for textField. |
errorClass | string | yes | fieldWithErrors | See documentation for textField. |
Examples
Section titled “Examples”<!--- Provide a `label` and the required `objectName` and `property` --->
<cfoutput>
#fileField(label="Photo", objectName="photo", property="imageFile")#
</cfoutput>
<!--- Display fields for photos provided by the `screenshots` association and nested properties --->
<fieldset>
<legend>Screenshots</legend>
<cfloop from="1" to="##ArrayLen(site.screenshots)##" index="i">
#fileField(label="File ####i##", objectName="site", association="screenshots", position=i, property="file")#
#textField(label="Caption ####i##", objectName="site", association="screenshots", position=i, property="caption")#
</cfloop>
</fieldset>