Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Validate Subquestions?

More
12 years 11 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.
More
12 years 11 months ago #85510 by Mazi
Replied by Mazi on topic Validate Subquestions?
Thanks for your help.

Feeld free to improve the manua whenever something is missing or not clear.

Best regards/Beste Grüße,
Dr. Marcel Minke
survey-consulting.com
offlinesurveys.com
Feel free to contact me by email for professional LimeSurvey support!
The topic has been locked.
More
12 years 10 months ago #86185 by Mazi
Replied by Mazi on topic Validate Subquestions?

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!

To my kniowledge Limesurvey 2 supports multilingual question attributes at the advanced question settings.

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
survey-consulting.com
offlinesurveys.com
Feel free to contact me by email for professional LimeSurvey support!
The topic has been locked.
More
9 years 3 months ago #135818 by codelogic
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.css
Code:
: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.
More
9 years 3 months ago #135823 by holch
Replied by holch on topic Validate Subquestions?
This should be a pure CSS based solution, as you can see.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The topic has been locked.
More
9 years 3 months ago #135854 by codelogic
Replied by codelogic on topic Validate Subquestions?

holch wrote: This should be a pure CSS based solution, as you can see.

Your right. Thanks!

My understanding of pseudo classes in CSS was lacking.
The topic has been locked.
More
7 years 3 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 !
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose