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

More
1 month 1 week ago #160298 by jokaru
jokaru created the topic: show validation tip only on error / choice of unacceptable answer option
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?

Please Log in to join the conversation.

More
1 month 1 week ago #160299 by Joffm
Joffm replied the topic: show validation tip only on error / choice of unacceptable answer option
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
Attachments:
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

More
1 month 1 week ago #160329 by jokaru
jokaru replied the topic: show validation tip only on error / choice of unacceptable answer option
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

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!