Welcome to the LimeSurvey Community Forum

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

show validation tip only on error / choice of unacceptable answer option

  • jokaru
  • jokaru's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 4 months ago #160298 by jokaru
Hi,

for some items in my survey, I would like to do a validation of a user's answers using question validation. If the answer is not a specified value (or maybe one of a set of acceptable values), I want to give the user feedback to reconsider their answer.

Right now, when I use, for instance, the validation tip below, the basic idea works out.

{if(a_SQ001==''," ",if(a_SQ001!='A7', "please reconsider your answer", ""))}

However, what I don't like is that even before the user has chosen any option, she always sees an exclamation mark above every question where I do validation. Is there a way to either replace the exclamation mark by an empty symbol or to make the question mark appear only after an (unacceptable) value has been chosen?
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 4 months ago #160299 by Joffm
Hello, jokaru,

your equation looks a bit strange.

What is the if(a_SQ001=='',"" part for?

And what kind of question are you using?
Looks like a multiple short text because you test against a "," and against a text "A7".

And where do you display this message?
You put it into the validation tip, don't you.

Better to put it into the question text.
Here an example for a single punch question:
Maybe like {if(!is_empty(Q1) AND Q1!=1,"<em>Please reconsider your answer</em>","")}


Furthermore you can style the text by some more css.
Like:
{if(!is_empty(Q1) AND Q1!=1,"<span style='color:red;font-style:italic;font-size:14pt;border:1px solid #FFFF00'>Please reconsider your answer</span>","")}

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • jokaru
  • jokaru's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 4 months ago #160329 by jokaru
Hi Joffm,

many thanks for that pointer. That certainly works.

I am using a simple array question with subquestions. The original condition was supposed to make the message appear only if some answer has already been chosen but not an acceptable one.

Best regards
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose