Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Radio button validation

New Here ,
Feb 19, 2009 Feb 19, 2009
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">
701
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 19, 2009 Feb 19, 2009
try using <cfif arounf your radio buttons
<cfif this condition
Radio1
<cfersle>
radio2
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 19, 2009 Feb 19, 2009
Pre-select one.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 19, 2009 Feb 19, 2009
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'.


Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources