'Wordpress - Multiple Checkboxes at least 1 checkbox should be required in Contact Form 7
I have a list of multiple check boxes in contact form 7 plugin form.
[checkbox checkbox-654 "test1"]
[checkbox checkbox-655 "test2"]
[checkbox checkbox-656 "test3"]
users can check all but at least 1 checkbox should be required. If the user submits without selecting any checkbox. The validation error should be displayed
How to make this happen?
Solution 1:[1]
The problem you're having is that you're doing a seperate shortcode for each box. All you need to do is group them by using quotes as below.
An asterisk means that AT LEAST ONE box must be checked. They can pick one or more. For multiple checkboxes, put each item in quotes as below.
[checkbox* checkbox-57 "Upgrade 1" "Upgrade 2"]
If person must check ONE BOX ONLY, use "exclusive". There is a shortcode builder in contact form 7 so not quite sure why you're having problems... For exclusive (one box only, required)
[checkbox* checkbox-56 exclusive "Offer 1" "Offer 2"]
If you dont want the checkboxes to be required, remove the asterisk.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | trainmania100 |