- Posts: 2
- Thank you received: 0
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
- Topic Author
- Offline
- New Member
Less
More
6 years 4 months ago #160298
by jokaru
show validation tip only on error / choice of unacceptable answer option was created 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?
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12713
- Thank you received: 3926
6 years 4 months ago #160299
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on 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
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
Attachments:
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- jokaru
- Topic Author
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
6 years 4 months ago #160329
by jokaru
Replied by jokaru on 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
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.