fileField()
Description
Builds and returns a string containing a file field form control based on the supplied objectName and property.
Function Syntax
fileField(objectName, property [, label, labelPlacement, prepend, append, prependToLabel, appendToLabel, errorElement ])
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
objectName |
any |
Yes | |
The variable name of the object to build the form control for. |
property |
string |
Yes | |
The name of the property to use in the form control. |
label |
string |
No | |
The label text to use in the form control. |
labelPlacement |
string |
No | around |
Whether to place the label before, after, or wrapped around the form control. |
prepend |
string |
No | |
String to prepend to the form control. Useful to wrap the form control around HTML tags. |
append |
string |
No | |
String to append to the form control. Useful to wrap the form control around HTML tags. |
prependToLabel |
string |
No | |
String to prepend to the form control's label. Useful to wrap the form control around HTML tags. |
appendToLabel |
string |
No | |
String to append to the form control's label. Useful to wrap the form control around HTML tags. |
errorElement |
string |
No | span |
HTML tag to wrap the form control with when the object contains errors. |
Examples
<!--- view code --->
<cfoutput>
<p>#fileField(objectName="photo", property="imageFile")#</p>
</cfoutput>
