- Posts: 84
- Thank you received: 21
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Validate Subquestions?
- TMSWhite
- Offline
- LimeSurvey Community Team
Less
More
11 years 7 months ago - 11 years 7 months ago #84342
by TMSWhite
If you depend upon LimeSurvey or the support team, please give generously to our 2012 fundraiser .
Replied by TMSWhite on topic Validate Subquestions?
For 1.92, you can do this:
For 2.0, I'd recommend making this field one of those that can be translated into multiple languages via the quick translation feature.
Code:
{if(validation_expression,'',if(LANG=='en','Please enter a valid ....','Bitte antworten ...'))}
For 2.0, I'd recommend making this field one of those that can be translated into multiple languages via the quick translation feature.
If you depend upon LimeSurvey or the support team, please give generously to our 2012 fundraiser .
- Expression Manager (EM):
Documentation
|
Sample Surveys
|
How Tos
|
Show Logic File
|
Upgrading to 1.92+ - Excel Style for Survey Structure Import/Export
Last edit: 11 years 7 months ago by TMSWhite.
The topic has been locked.
- DenisChenu
- Away
- LimeSurvey Community Team
Less
More
- Posts: 13910
- Thank you received: 2546
11 years 7 months ago - 11 years 7 months ago #84367
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Validate Subquestions?
Hello,
Can use pseudo class lang too in template.css:
And in template.css
Denis
Can use pseudo class lang too in template.css:
Code:
<span lang="en">'Please enter </span><span lang="de">Bitte antworten</span>
And in template.css
Code:
:lang(en) :lang(de){display:none} :lang(de) :lang(en){display:none}
Denis
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 11 years 7 months ago by DenisChenu. Reason: typo and code
The topic has been locked.
- Bitbull
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
11 years 6 months ago #85375
by Bitbull
Replied by Bitbull on topic Validate Subquestions?
Sorry to dig up this (old) thread, but I've got a serious problem with validation of subquestions. I've attached my survey here (sorry, it's in Dutch, but easy to understand as I've stripped it down to the problematic question).
I really don't see why I can't get past the question (when testing the whole survey, that seems to be impossible, a message keeps popping up). Regular expressions have been validated, everything seems fine with "realtime validation", but impossible to get past the question.
Could you guys please take a look and tell me what I'm doing wrong?
Thanks in advance!
I really don't see why I can't get past the question (when testing the whole survey, that seems to be impossible, a message keeps popping up). Regular expressions have been validated, everything seems fine with "realtime validation", but impossible to get past the question.
Could you guys please take a look and tell me what I'm doing wrong?
Thanks in advance!
Attachments:
The topic has been locked.
- Bitbull
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
11 years 6 months ago #85442
by Bitbull
Replied by Bitbull on topic Validate Subquestions?
Okay, I already found the solution.
Apparently, regular expressions in LimeSurvey need to start & end with / character.
It was possible to notice in the example, but I found it nowhere clearly stated, only here (point 2)
Apparently, regular expressions in LimeSurvey need to start & end with / character.
It was possible to notice in the example, but I found it nowhere clearly stated, only here (point 2)
The topic has been locked.
- Mazi
- Offline
- Official LimeSurvey Partner
11 years 6 months ago #85482
by Mazi
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
Replied by Mazi on topic Validate Subquestions?
If you are missing this information at our manual, please add it there. It's a wiki, everyone can edit it.
You can also post a feature request at our idea tracker to add some JavaScript validation before saving a regular expression. Such a script can check for the first characters and throw an error.
You can also post a feature request at our idea tracker to add some JavaScript validation before saving a regular expression. Such a script can check for the first characters and throw an error.
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
- Bitbull
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
11 years 6 months ago #85496
by Bitbull
Replied by Bitbull on topic Validate Subquestions?
Okay, I added the note to
the wiki page
.
The topic has been locked.
- Mazi
- Offline
- Official LimeSurvey Partner
11 years 6 months ago #85510
by Mazi
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
Replied by Mazi on topic Validate Subquestions?
Thanks for your help.
Feeld free to improve the manua whenever something is missing or not clear.
Feeld free to improve the manua whenever something is missing or not clear.
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
- Mazi
- Offline
- Official LimeSurvey Partner
11 years 5 months ago #86185
by Mazi
There is also an interesting blog post at www.limesurvey-consulting.com which describes different methods of validating email addresses:
" How to validate email addresses at Limesurvey "
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
Replied by Mazi on topic Validate Subquestions?
To my kniowledge Limesurvey 2 supports multilingual question attributes at the advanced question settings.debianese wrote: Thanks! But I have another question: How can you localize the error message?
I have to create a survey in german and english. The error message should be in the selected language!
There is also an interesting blog post at www.limesurvey-consulting.com which describes different methods of validating email addresses:
" How to validate email addresses at Limesurvey "
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
- codelogic
- Offline
- Junior Member
Less
More
- Posts: 21
- Thank you received: 4
7 years 10 months ago #135818
by codelogic
"LANG" is not working for me in 2.50+
Using this method would you use Javascript to toggle a given language text on if it was currently enabled? If so in Javascript is there a better way to get the language other then looking at the body tag for a class named "lang-??"
Replied by codelogic on topic Validate Subquestions?
TMSWhite wrote: For 1.92, you can do this:
{if(validation_expression,'',if(LANG=='en','Please enter a valid ....','Bitte antworten ...'))}
For 2.0, I'd recommend making this field one of those that can be translated into multiple languages via the quick translation feature.
"LANG" is not working for me in 2.50+
DenisChenu wrote: Hello,
Can use pseudo class lang too in template.css:
Code:<span lang="en">'Please enter </span><span lang="de">Bitte antworten</span>
And in template.cssCode::lang(en) :lang(de){display:none} :lang(de) :lang(en){display:none}
Denis
Using this method would you use Javascript to toggle a given language text on if it was currently enabled? If so in Javascript is there a better way to get the language other then looking at the body tag for a class named "lang-??"
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11746
- Thank you received: 2750
7 years 10 months ago #135823
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Validate Subquestions?
This should be a pure CSS based solution, as you can see.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- codelogic
- Offline
- Junior Member
Less
More
- Posts: 21
- Thank you received: 4
7 years 10 months ago #135854
by codelogic
My understanding of pseudo classes in CSS was lacking.
Replied by codelogic on topic Validate Subquestions?
Your right. Thanks!holch wrote: This should be a pure CSS based solution, as you can see.
My understanding of pseudo classes in CSS was lacking.
The topic has been locked.
- sys
- Offline
- New Member
Less
More
- Posts: 1
- Thank you received: 0
5 years 10 months ago #168844
by sys
Replied by sys on topic Validate Subquestions?
Hello,
Thank you very much for your contribution. If you do distance learning I'm interested! But I have a problem with this solution: If I answer or not, there is an error message that tells me that I did not answer a question. Can you help me?
here is my code:
(is_empty(271338X244X3855SQ001) or regexMatch('/^[1-9]$|^10$/',271338X244X3855SQ001))
and
(is_empty(271338X244X3855SQ002) or or regexMatch('/^[1-9][0-9]{0,1}$|^10[0-9]$|^11 [0-9]$|^120$/',271338X244X3855SQ002))
{if((is_empty(271338X244X3855SQ001) or regexMatch('/^[1-9]$|^10$/',271338X244X3855SQ001)),'Veuillez vérifier le format de votre réponse. .<br />',' Entrez un nombre d’années valide.<br />')}
{if((is_empty(271338X244X3855SQ002) or regexMatch('/^[1-9][0-9]{0,1}$|^10[0-9]$|^11[0-9]$|^120$/',271338X244X3855SQ002)),'','Entrez un nombre de mois valide.')}
I have another question; can you tell me what's wrong with this code?
(is_empty(271338X245X3882SQ001) or (271338X245X3882SQ001+271338X245X3882SQ002== 271338X245X3881))
{if((is_empty(271338X245X3882SQ001) or (271338X245X3882SQ001+271338X245X3882SQ002==271338X245X3881)),’ Veuillez vérifier le format de votre réponse.’,’Vérifiez la cohérence de vos réponses.’))
Thanks you so much !
Thank you very much for your contribution. If you do distance learning I'm interested! But I have a problem with this solution: If I answer or not, there is an error message that tells me that I did not answer a question. Can you help me?
here is my code:
(is_empty(271338X244X3855SQ001) or regexMatch('/^[1-9]$|^10$/',271338X244X3855SQ001))
and
(is_empty(271338X244X3855SQ002) or or regexMatch('/^[1-9][0-9]{0,1}$|^10[0-9]$|^11 [0-9]$|^120$/',271338X244X3855SQ002))
{if((is_empty(271338X244X3855SQ001) or regexMatch('/^[1-9]$|^10$/',271338X244X3855SQ001)),'Veuillez vérifier le format de votre réponse. .<br />',' Entrez un nombre d’années valide.<br />')}
{if((is_empty(271338X244X3855SQ002) or regexMatch('/^[1-9][0-9]{0,1}$|^10[0-9]$|^11[0-9]$|^120$/',271338X244X3855SQ002)),'','Entrez un nombre de mois valide.')}
I have another question; can you tell me what's wrong with this code?
(is_empty(271338X245X3882SQ001) or (271338X245X3882SQ001+271338X245X3882SQ002== 271338X245X3881))
{if((is_empty(271338X245X3882SQ001) or (271338X245X3882SQ001+271338X245X3882SQ002==271338X245X3881)),’ Veuillez vérifier le format de votre réponse.’,’Vérifiez la cohérence de vos réponses.’))
Thanks you so much !
The topic has been locked.