WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
[resolved] Can't Make Radio Button A Required Field (7 posts)

  1. demonboy
    Member
    Posted 2 years ago #

    I've just noticed that some people are not submitting the radio button question yet it is allowing them to send the form. Why can I not make the radio button type question mandatory?

    http://wordpress.org/extend/plugins/contact-form-7/

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 2 years ago #

    A radio button is a required field by nature.

    Checkboxes, Radio Buttons and Menus

    Use checkbox instead if you want to make it required.

  3. demonboy
    Member
    Posted 2 years ago #

    OK, thanks for that.

    As an ex-market researcher and questionnaire designer I should point out that tick (check) boxes should not be mutually exclusive unless the last tick box is 'None of the above', where ticking it unticks all previous tick boxes. Tick boxes were designed specifically for non-mutually exclusive lists, though nowadays they are used like radio buttons as an aesthetic alternative (mixing up the response type in a survey helps reduce repetitiveness).

    I'm not sure what you mean by a radio button being 'a required field by nature'. Radio buttons are specifically for mutually exclusive options but that doesn't make them 'required' if the question itself is not mandatory. I assume the author of this plugin has designed it this way for a technical reason.

    Either way, I appreciate your response.

  4. Johnathan69
    Member
    Posted 2 years ago #

    @Takayuki

    Thanks for the great plug-in.....Really useful and so user friendly.

    I am also having difficulty with the form being submitted without the 'radio buttons' being selected. I've thought about the idea of having one selected by default, but then incorrect information could be submitted by accident. Checkboxes are another alternative that I've thought about, but they leave the potential of having more than one box checked (in this case, I cannot have that).

    I've also thought about the dropdown / [select] feature, but it is less desirable than displaying all of the information at once, as with the radio buttons with labels.

    Any guidance that you could provide would be appreciated. よろしくお願いします。

  5. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 2 years ago #

    You can use exclusive option of checkbox for such purposes like this:

    [checkbox* your-fruit exclusive "Apple" "Banana" "Grape"]

  6. Johnathan69
    Member
    Posted 2 years ago #

    @Takayuki

    Thank you for the quick reply.....nice Javascript trick! I think that I might have used this before, but wasn't sure if it would work in your form (of course it's in the 'Docs' section)

    I was wondering if people are used to seeing this kind of 'unchecking' checkbox....? Anyways a solution.

    どうもです!

  7. demonboy
    Member
    Posted 2 years ago #

    @Takayuki - my apologies, I didn't realise you were the designer of the plug-in. Nice work, and thanks for responding to my question.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic