- Posts: 2
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
nice warnings in multiple choice
- Lombego
- Topic Author
- Offline
- New Member
Less
More
8 years 2 months ago #131418
by Lombego
nice warnings in multiple choice was created by Lombego
Hi,
I have a simple multiple choice question with checkboxes. I want a nice error warning if someone checks more than 3 checkboxes. But the only thing I can do is an ugly JS-Error, when I submit the form.
I looked in "Demo of em_validation_sq" and the last question G2 > Test is almost what I want, except, that it is an Array question. I tried a lot of Question validation equations but nothing worked for my multiple choice question.
So: Is it possible to get that nice and instant warning for multiple choice questions?
Thanks,
Thomas
I have a simple multiple choice question with checkboxes. I want a nice error warning if someone checks more than 3 checkboxes. But the only thing I can do is an ugly JS-Error, when I submit the form.
I looked in "Demo of em_validation_sq" and the last question G2 > Test is almost what I want, except, that it is an Array question. I tried a lot of Question validation equations but nothing worked for my multiple choice question.
So: Is it possible to get that nice and instant warning for multiple choice questions?
Thanks,
Thomas
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10098
- Thank you received: 3589
8 years 2 months ago #131426
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic nice warnings in multiple choice
You can use something like this in the Question validation tip:
Sample survey attached:
Code:
{if(count(self) > 3, 'Please check a maximum of 3 answers.', '')}
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The topic has been locked.
- Lombego
- Topic Author
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
8 years 2 months ago #131430
by Lombego
Replied by Lombego on topic nice warnings in multiple choice
Thank you. It worked.
Just a tiniy problem in your example the text shows up as alert-danger. In my template (almost the same as default) it is alert-info (the same as the question-helptext).
Just a tiniy problem in your example the text shows up as alert-danger. In my template (almost the same as default) it is alert-info (the same as the question-helptext).
The topic has been locked.