Viewing 5 replies - 1 through 5 (of 5 total)
  • davejampole

    (@davejampole)

    If you read this <https://contactform7.com/checkboxes-radio-buttons-and-menus/&gt;, you’ll see that by their very nature, radio buttons are required.

    Thread Starter mjefferson96

    (@mjefferson96)

    The problem is that the radio button are NOT required when I hit SEND without filling in a selection, it sends just fine with NO value. So no, that does not help at all if I do not want to add a default value.
    As it stands now I will simply add ” default:1 ” before the first radio selection just so that will be required to leave it or change it.

    davejampole

    (@davejampole)

    Just going by what the docs say. Sounds like it’s time for the CF7 creator to jump on this.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Just as the doc says, radio buttons are “required” by nature. Setting a default value is always a good practice. When you don’t want to set a default option, you can use checkbox* tag with exclusive option instead. It behaves like radio buttons, but still works as checkboxes.

    for more detail
    Checkboxes, Radio Buttons and Menus

    I just had a look at the latest HTML5 spec for this and it looks different than the older version:

    https://www.w3.org/html/wg/drafts/html/master/forms.html#radio-button-state-(type=radio)

    Constraint validation: If an element in the radio button group is required, and all of the input elements in the radio button group have a checkedness that is false, then the element is suffering from being missing.

    With respect Takayuki, checkboxes don’t look exclusive, so making them exclusive for some questions is confusing and unnecessary – that’s what radio buttons are for.

    Take the example of a gender question – radio buttons are the obvious choice, having checkboxes would be downright weird because of their non-exclusive appearance. If it’s an important and required question, making one radio button option pre-selected is a recipe for unreliable results.

    Thanks for an awesome plugin!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How do I make a radio button REQUIRED?’ is closed to new replies.