Welcome to the LimeSurvey Community Forum

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

How to verify two input are the same?

  • mrli999
  • mrli999's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
9 years 1 month ago #134210 by mrli999
How to verify two input are the same? was created by mrli999
In one survey, we hope the respondent to input their email address. In order to assure their email address are correct, we ask them to input email address twice. How can we verify those two input are the same? IF they are the same, go ahead; if not , a warning: the second email address is not the same as the first one.

Please see the image below:


Attachments:
The topic has been locked.
More
9 years 1 month ago #134240 by eloner
Replied by eloner on topic How to verify two input are the same?
You can do:

Q1. What is your e-mail? _____
_
Q2. You wrote: {Q1}. Is this correct?
- Yes
- No

If (No) Q3. Please enter the correct address

cheers Elo
The topic has been locked.
More
9 years 1 month ago #134259 by jelo
Replied by jelo on topic How to verify two input are the same?
A lot of questions in a short period of time.

You can use the validation field. In the second text question (Your email again) you enter the question code of the first text question (Your email). You can add a validation tip to inform users that E-Mailadress in both fields are not matching.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: first
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 1 month ago #134261 by tpartner
Replied by tpartner on topic How to verify two input are the same?
I agree with jelo's suggestion but I would use a multiple-short-text type question so the validation and tip are all in one place.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
9 years 1 month ago - 9 years 1 month ago #134319 by first
Replied by first on topic How to verify two input are the same?

Survey Designer and Programmer
Last edit: 9 years 1 month ago by first. Reason: typo
The topic has been locked.
More
9 years 1 month ago #134324 by jelo
Replied by jelo on topic How to verify two input are the same?
I wouldn't use additional regex checking to validate email structure.
There is no way to check every email.
elliot.land/validating-an-email-address

To minimize wrongly written emails another way might be to use scripts suggesting emails
E.g. github.com/mailcheck/mailcheck

BTW: I really starting to getting annoyed and demotivated posting on the forum. Flooding protection is nagging for 120sec pause. You cannot post three links in one post.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 1 month ago #134342 by tpartner
Replied by tpartner on topic How to verify two input are the same?

I really starting to getting annoyed and demotivated posting on the forum. Flooding protection is nagging for 120sec pause. You cannot post three links in one post.

Maybe ping Carsten direct - I doubt he'll see your concerns here.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • mrli999
  • mrli999's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
9 years 1 month ago #134371 by mrli999
Replied by mrli999 on topic How to verify two input are the same?

tpartner wrote: I agree with jelo's suggestion but I would use a multiple-short-text type question so the validation and tip are all in one place.


I used this method. And

Question validation equation:
(is_empty(newemail_a1) or (regexMatch('/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/', newemail_a1) and newemail_a1==newemail_a2))


Question validation tip: {if(is_empty(newemail_a1) and is_empty(newemail_a2), '',if(regexMatch('/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/', newemail_a1) or regexMatch('/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/', newemail_a2), if(newemail_a1==newemail_a2, '', "Email Addresses are not the same"), "Invalid Email Address"))}

It seems work. But I don't know exactly whether it will work or not? How do you think about it?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 4 weeks ago - 9 years 4 weeks ago #134426 by tpartner
Replied by tpartner on topic How to verify two input are the same?
See jelo's comment about validating email addresses with a regex - www.limesurvey.org/forum/can-i-do-this-w...-are-the-same#134324

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 9 years 4 weeks ago by tpartner.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose