Welcome, Guest
Username: Password:
  • Page:
  • 1
  • 2

TOPIC: Validate Subquestions?

Validate Subquestions? 3 years 9 months ago #84342

  • TMSWhite
  • TMSWhite's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 758
  • Thank you received: 83
  • Karma: 37
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.
Last Edit: 3 years 9 months ago by TMSWhite.
The administrator has disabled public write access.

Validate Subquestions? 3 years 9 months ago #84367

  • DenisChenu
  • DenisChenu's Avatar
  • Online
  • Moderator Lime
  • Posts: 8951
  • Thank you received: 1257
  • Karma: 371
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
Last Edit: 3 years 9 months ago by DenisChenu. Reason: typo and code
The administrator has disabled public write access.

Validate Subquestions? 3 years 8 months ago #85375

  • Bitbull
  • Bitbull's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
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!
Attachments:
The administrator has disabled public write access.

Validate Subquestions? 3 years 8 months ago #85442

  • Bitbull
  • Bitbull's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
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)
The administrator has disabled public write access.

Validate Subquestions? 3 years 8 months ago #85482

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5965
  • Thank you received: 364
  • Karma: 259
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.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Validate Subquestions? 3 years 8 months ago #85496

  • Bitbull
  • Bitbull's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
Okay, I added the note to the wiki page.
The administrator has disabled public write access.

Validate Subquestions? 3 years 8 months ago #85510

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5965
  • Thank you received: 364
  • Karma: 259
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
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Validate Subquestions? 3 years 8 months ago #86185

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5965
  • Thank you received: 364
  • Karma: 259
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
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Validate Subquestions? 3 weeks 23 hours ago #135818

  • codelogic
  • codelogic's Avatar
  • Offline
  • Junior Lime
  • Posts: 30
  • Thank you received: 4
  • Karma: 2
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-??"
The administrator has disabled public write access.

Validate Subquestions? 3 weeks 22 hours ago #135823

  • holch
  • holch's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 4904
  • Thank you received: 720
  • Karma: 220
This should be a pure CSS based solution, as you can see.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Validate Subquestions? 3 weeks 18 hours ago #135854

  • codelogic
  • codelogic's Avatar
  • Offline
  • Junior Lime
  • Posts: 30
  • Thank you received: 4
  • Karma: 2
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 administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.425 seconds