/t5/coldfusion-discussions/radio-button-validation/td-p/763529Feb 19, 2009
Feb 19, 2009
Copy link to clipboard
Copied
Using coldfusion validation only, how can I make a radio
field required? For example, the below code does not work:
<cfinput type="radio" name="test" value="yes"
required="true" message="You must enter a value for test">
<cfinput type="radio" name="test" value="no"
required="true" message="You must enter a value for
test">
/t5/coldfusion-discussions/radio-button-validation/m-p/763532#M71017Feb 19, 2009
Feb 19, 2009
Copy link to clipboard
Copied
LATEST
just make one of your radio buttons pre-selected (i.e. the
default choice).
in a radio group only one of buttons can be selected at a
time, and if
you have one pre-selected then one of the buttons will always
be
selected because a radio button can't be 'un-checked'.