Skip to content

Miscellaneous

radioButtonTag()

radioButtonTag() — returns any

Builds and returns a string containing a radio button 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
namestringyesSee documentation for textFieldTag.
valuestringyesSee documentation for textFieldTag.
checkedbooleanyesfalseWhether or not to check the radio button by default.
labelstringyesSee documentation for textField.
labelPlacementstringyesaroundSee documentation for textField.
prependstringyesSee documentation for textField.
appendstringyesSee documentation for textField.
prependToLabelstringyesSee documentation for textField.
appendToLabelstringyesSee documentation for textField.
<!--- Basic usage usually involves a `label`, `name`, `value`, and `checked` value --->
<cfoutput>
	<fieldset>
		<legend>Gender</legend>
		#radioButtonTag(name="gender", value="m", label="Male", checked=true)#<br>
		#radioButtonTag(name="gender", value="f", label="Female")#
	</fieldset>
</cfoutput>