How to verify two input are the same?

More
3 years 7 months ago #134210 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:

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
3 years 7 months ago #134240 by eloner
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

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #134259 by jelo
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

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #134261 by tpartner
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.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago - 3 years 7 months ago #134319 by first

Survey Designer and Programmer
Last edit: 3 years 7 months ago by first. Reason: typo

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #134324 by jelo
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

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #134342 by tpartner

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.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #134371 by mrli999

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?

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago - 3 years 7 months ago #134426 by tpartner
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.
Official LimeSurvey Partner - partnersurveys.com
Last edit: 3 years 7 months ago by tpartner.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!