radioButton()
Description
Builds and returns a string containing a radio button form control based on the supplied objectName and property.
Function Syntax
radioButton(objectName, property, tagValue [, 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. |
tagValue |
string |
Yes | |
The value of the radio button when selected. |
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>
#radioButton(objectName="user", property="gender", tagValue="m", label="Male")#<br />
#radioButton(objectName="user", property="gender", tagValue="f", label="Female")#
</p>
</cfoutput>
