Buy Now
Sign in

Checkbox group - 3 out of 4 must be checked - how to?

kdi77 , November 06 at 09:00
Answered
K
kdi77
Hello there,
first of all I hope you can understand my issue, my English skills are a little bit rusty an this is even a bit hard to explain in German
We have a Chronoforms V6 form where the user has to check 3 out of 4 options to fulfill the requirements for a membership in a society. How can I do this in Chronoforms?
I have a checkbox group with the four options (let's say they are 1,2,3,4). The user has to check either 1,3 and 4 or 2,3, and 4. 1 and 2 are pretty similar, so they won't choose 1 & 2 at the same time. But it is important that 3 and 4 are cosen, too.
When looking at the validation tab in my checkbox group, I can fill in "Minimum choices" and "Maximum choices". Can I put there a "3" and a "4" for the amount of boxes that can/must be checked?
Thanks in advance!
Best regards,
Kathrin
GreyHead
Hi Kathrin,
You could try setting 3 for a minimum - but this would allow 1, 2 & 3; or you can use a radio button group for 1 & 2 and a checkbox group for 3 & 4 . . . or you can use the current setup but add a custom JavaScript validation function.
Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
K
kdi77
Hi Bob,
thank you! I will try setting 3 for a minimum, that would be the easiest way. The JavaScript validation function is a little bit too difficult for me.
Thanks again & Bye
Kathrin
K
kdi77
Hello again,
we just discovered another issue in our form (it is the same form as above): we have our checkbox group with four boxes. If I check all the four, only the last one will be sent in the email and also stored in the database.
The checkbox group is configured like this:
Option 1=Option1
Option 2=Option2
Option 3=Option3
Option 4=Option4
And in the validation I chose "required" so that the user has to choose at least one of the options.
In my email and in the database, only the last one (Option 4 in this case) is sent, except when I just choose Option 1.
What can I do to make sure that all of the Options will be sent in the email and saved in the database?
If necessary, I can send you a link to my form.
Thanks again in advance,
Kathrin
GreyHead
Hi Kathrin,
Please make sure that the CheckBox group has an array name ending in square brackets [.] e.g. my_group[.] but without the .
Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
K
kdi77
I put the array name ending in [] and it works fine, thanks!
healyhatman
An array name ending in square brackets he means so [ ] (without the space)
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman