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.
Name | Type | Required | Default | Description |
---|---|---|---|---|
objectName | any | Yes | See documentation for textField. | |
property | string | Yes | See documentation for textField. | |
association | string | No | See documentation for textfield. | |
position | string | No | See documentation for textfield. | |
label | string | No | useDefaultLabel | See documentation for textField. |
labelPlacement | string | No | around | See documentation for textField. |
prepend | string | No | See documentation for textField. | |
append | string | No | See documentation for textField. | |
prependToLabel | string | No | See documentation for textField. | |
appendToLabel | string | No | See documentation for textField. | |
errorElement | string | No | span | See documentation for textField. |
errorClass | string | No | fieldWithErrors | See documentation for textField. |
<!--- 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>