• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Email Confirm / Validate Field

Explorer ,
Oct 06, 2020 Oct 06, 2020

Copy link to clipboard

Copied

Hello everyone, I am new to this forum and any and ALL help would be beyond appreciated on this:  I am creating a form where I need to have a box for a user to enter their "email" - lets call the box "email" and then I need them to re-enter the email to confirm that is what they wrote initially (lets call that "validate email").  This way human error can be avoided.  Finally a message would alert the user if the boxes DO NOT match.  This is what I am currently attempting but it is not working:

 

email==confirmEmail?"":msg;

 

I have also tried this:

 

if (! eMailValidate(event.value) && event.value != "") {
event.rc = false;
app.alert({
cMsg: "Invalid email address - Please try again",
cTitle: "Email1",
nIcon: 0,
nType: 1
});
}

 

BUT while this is nice, it doesnt confirm the email.  It would be nice to have both features in one.  Thank you all for your valuable time and assistance in advance.

 

I got the following as an answer:

You can use this:

 

var email1 = this.getField("email").valueAsString;
var email2 = this.getField("confirmEmail").valueAsString;
if (email1!=email2) app.alert("The email addresses you entered do not match!");

 

However, I replied:

 

Thank you so much for the quick reply! Im so sorry I didnt write back sooner, I received a notification today that a reply was posted but it shows you replied immediately after I posted it. I used your formula in the "validate" (run custom validation script).  I labeled the boxes ("email" for box 1 and "emailConfirm") I placed the validation script on "emailConfirm" and it DID NOT work.  I tinkered with it on purpose and wrote: "John" on box1 and then "Jay" on box2... I received an error message (which is what I want) but when I then did: "john@gmail.com" and then repeated the email on box2... it STILL gave me the error message.  So the popup alert works perfect but maybe I'm inputting the validation script in the wrong place? I thought this was correct. Thank you for your valuable time and help!

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 06, 2020 Oct 06, 2020

In that case you can use this code:

 

if(event.value != this.getField("email").valueAsString){
app.alert("The email addresses you entered do not match!");}
else if(event.value == this.getField("email").valueAsString){
app.alert("Email Confirmed!", 3);}

Votes

Translate

Translate
LEGEND ,
Oct 06, 2020 Oct 06, 2020

Copy link to clipboard

Copied

I moved your post over from the poorly named "Using the Community" forum, which is for getting help using this forum system, to a better forum.


I hope this helps. Best of luck to you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 06, 2020 Oct 06, 2020

Copy link to clipboard

Copied

You can use this as custom validation script of "confirmEmail" field:

if(event.value != this.getField("email").valueAsString){
app.alert("The email addresses you entered do not match!");}

this won't give you alert if fields are the same.

Sry I didn't understand what you mean to also confirm email?

You want some sort of alert if emails match?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 06, 2020 Oct 06, 2020

Copy link to clipboard

Copied

Thank you for the prompt reply, I will try it now and yes... that's exactly what I was asking. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 06, 2020 Oct 06, 2020

Copy link to clipboard

Copied

In that case you can use this code:

 

if(event.value != this.getField("email").valueAsString){
app.alert("The email addresses you entered do not match!");}
else if(event.value == this.getField("email").valueAsString){
app.alert("Email Confirmed!", 3);}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 07, 2020 Oct 07, 2020

Copy link to clipboard

Copied

Thank you so much for your help Nesa! I'm so sorry I didn't reply yesterday. My laptop after 5 years finally crapped out! 😬 I saved my work and need to transfer it to the new laptop from my external drive. I'm certain the code works as it looks good! I sincerely appreciate you! I'm new to this so let me figure out how to provide you with the credit for the correct answer. Thank you, thank you, thank you!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 06, 2020 Oct 06, 2020

Copy link to clipboard

Copied

"and then I need them to re-enter the email to confirm that is what they wrote initially (lets call that "validate email"). This way human error can be avoided. "

I think on the contrary that it multiplies the risk of data entry error by two.
Besides, it's a bit insulting, why not also ask him twice for his name or his phone number?

😉

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 07, 2020 Oct 07, 2020

Copy link to clipboard

Copied

LATEST

Thank you JR, I appreciate your reply and I get what you're saying. Believe me, if most people were as smart as people who code, design and overall work in I.T. and related fields, I would just put it once BUT... we know that's not the case so it's just a precaution measure (AND you'd be incredibly surprised how many actually fail to do it right the first time.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines