- Posts: 93
- Thank you received: 1
- Forum
- English support forums
- Can I do this with LimeSurvey?
- Tell somebody that answer entered is not correct
Tell somebody that answer entered is not correct
5 years 7 months ago #84882
by ricardo01
ricardo01 created the topic: Tell somebody that answer entered is not correct
I want to create a short text question like this:
Please enter the last 4 digits of your phone number:
if the number does not match the number in, say, the token table, I'd like the person gets a warning saying "This number doesn't match the number you entered in the previous survey."
Is this possible to achieve with LS?
This is for a pre-post survey design, which needs to be anonymous, but still we need to compare how a person answered the survey at two different points in time.
ricardo
Please enter the last 4 digits of your phone number:
if the number does not match the number in, say, the token table, I'd like the person gets a warning saying "This number doesn't match the number you entered in the previous survey."
Is this possible to achieve with LS?
This is for a pre-post survey design, which needs to be anonymous, but still we need to compare how a person answered the survey at two different points in time.
ricardo
Please Log in or Create an account to join the conversation.
5 years 7 months ago #84890
by Mazi
Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
Mazi replied the topic: Tell somebody that answer entered is not correct
This is possible. Using conditions you can show a text display question if the numbers don't match. If your survey is NON anonymous, you can create a condition like
IF question X != token:attribute_y
Note that the user will still be able to click next. You need some custom JavaScript to disable the next button in this case.
IF question X != token:attribute_y
Note that the user will still be able to click next. You need some custom JavaScript to disable the next button in this case.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
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.
5 years 7 months ago #84891
by TMSWhite
If you depend upon LimeSurvey or the support team, please give generously to our 2012 fundraiser .
TMSWhite replied the topic: Tell somebody that answer entered is not correct
Alternatively, you can use
Question Validation Equation
The Question Validation Equation would be:
And the Question Validation Tip would be:
This approach will show the error message only if the person enters 4 digits and they differ from the stored value. This will also prevent the person from advancing to the next page if they don't enter the correct value.
To ensure that they enter something, you can make the question mandatory.
The Question Validation Equation would be:
strlen(trim(X))>=4 && trim(X)!=TOKEN:ATTRIBUTE_1
And the Question Validation Tip would be:
This number doesn't match the number you entered in the previous survey
This approach will show the error message only if the person enters 4 digits and they differ from the stored value. This will also prevent the person from advancing to the next page if they don't enter the correct value.
To ensure that they enter something, you can make the question mandatory.
If you depend upon LimeSurvey or the support team, please give generously to our 2012 fundraiser .
- Expression Manager (EM):
Documentation
|
Sample Surveys
|
How Tos
|
Show Logic File
|
Upgrading to 1.92+ - Excel Style for Survey Structure Import/Export
Please Log in or Create an account to join the conversation.
5 years 7 months ago #84894
by Mazi
Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
Mazi replied the topic: Tell somebody that answer entered is not correct
Great solution which also makes sure that the user can't proceed to the next question.
I guess we can do something similar when having an email and email confirmation text field?
I guess we can do something similar when having an email and email confirmation text field?

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
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.
5 years 7 months ago #84898
by TMSWhite
If you depend upon LimeSurvey or the support team, please give generously to our 2012 fundraiser .
TMSWhite replied the topic: Tell somebody that answer entered is not correct
Yes, you could do that.
Furthermore, if you are worried about security, you could add a crypt() function to Expression Manager, and change the validation equation to:
Furthermore, if you are worried about security, you could add a crypt() function to Expression Manager, and change the validation equation to:
strlen(trim(X)>=4 && crypt(trim(X))==TOKEN:ATTRIBUTE_1
If you depend upon LimeSurvey or the support team, please give generously to our 2012 fundraiser .
- Expression Manager (EM):
Documentation
|
Sample Surveys
|
How Tos
|
Show Logic File
|
Upgrading to 1.92+ - Excel Style for Survey Structure Import/Export
Please Log in or Create an account to join the conversation.
5 years 7 months ago #84902
by ricardo01
ricardo01 replied the topic: Tell somebody that answer entered is not correct
Thank you guys...Mazi, TMSWhite, you made me curious, so I'd be remiss if I don't ask what would be the equation to use in an email/email confirmation situation
Cheers,
ricardo
Cheers,
ricardo
Please Log in or Create an account to join the conversation.
5 years 7 months ago #84911
by ricardo01
ricardo01 replied the topic: Tell somebody that answer entered is not correct
One more question: How can I make the warning appear in red?
Please Log in or Create an account to join the conversation.
4 years 10 months ago #96444
by dweisser
dweisser replied the topic: Tell somebody that answer entered is not correct
I know this is an old post, but check this out in relation to your question about matching email fields.
-Nebraska
-Nebraska
Please Log in or Create an account to join the conversation.