Validate Subquestions?

More
6 years 1 week ago #85496 by Bitbull
Bitbull replied the topic: Validate Subquestions?
Okay, I added the note to the wiki page .

Please Log in or Create an account to join the conversation.

More
6 years 1 week ago #85510 by Mazi
Mazi replied the 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
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in or Create an account to join the conversation.

More
5 years 11 months ago #86185 by Mazi
Mazi replied the 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
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #135818 by codelogic
codelogic replied the 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:

<span lang="en">'Please enter </span><span lang="de">Bitte antworten</span>

And in template.css
: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-??"

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #135823 by holch
holch replied the topic: Validate Subquestions?
This should be a pure CSS based solution, as you can see.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #135854 by codelogic
codelogic replied the 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.

Please Log in or Create an account to join the conversation.

More
4 months 1 week ago #168844 by sys
sys replied the 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 !

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!