Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6070527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:56:37+00:00 2026-05-23T09:56:37+00:00

This is my form validation for the email address – field email1 – what

  • 0

This is my form validation for the email address – field email1 – what I need to do is add a second validation – email1 is equal to email2 and if not, then a different alert message displays. I tried to add:

if (f.email1.value != f.email2.value)
{
    customAlert ("email2",bnadd_msg_005);
    return (false);
}

But that didn’t work for me. Any insight?

case "email1":
                        // Checking to make sure email field is on the form
                        if (typeof f.email1 != "undefined") 
                        {
                            if ((f.email1.value == "") && (f.sameAsShip.checked) )
                            {
                                customAlert ("email1",bnadd_msg_018);
                                if ((typeof TeaLeaf != "undefined") && (typeof TeaLeaf.Client != "undefined") && (typeof TeaLeaf.Client.tlAddEvent != "undefined") ) {
                                        var nVO = { ErrorMessage : bnadd_msg_018} 
                                        TeaLeaf.Event.tlAddCustomEvent(subtype, nVO);
                                    }
                                return false;
                            }
                            //Validate that email address has @ and .
                            if(f.email1 && ( f.email1.value != "" ) && (!editEmail(f.email1.value,'Email Address'))) 
                            {
                                return false;
                            }
                            if(addrType == atBill)
                            {


                                if(f.email1.value == "")
                                {
                                    customAlert ("email1",bnadd_msg_018);
                                    if ((typeof TeaLeaf != "undefined") && (typeof TeaLeaf.Client != "undefined") && (typeof TeaLeaf.Client.tlAddEvent != "undefined") ) {
                                        var nVO = { ErrorMessage : bnadd_msg_018} 
                                        TeaLeaf.Event.tlAddCustomEvent(subtype, nVO);
                                    }
                                    return false;
                                }
                                else
                                {
                                    if(f.email1 && ( f.email1.value != "" ) && (!editEmail(f.email1.value,'Email Address'))) 
                                    {
                                        return false;
                                    }
                                    else
                                        return true;    
                                }


                            }

                        }
                        break;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:56:38+00:00Added an answer on May 23, 2026 at 9:56 am

    Working. Thanks for the help on prior questions.

    case "email2":
                            // Checking to make sure email field is on the form
                            if (typeof f.email2 != "undefined") 
                            {
                                if ((f.email2.value != f.email1.value) && (f.sameAsShip.checked) )
                                {
                                    customAlert ("email2",bnadd_msg_005);
                                    if ((typeof TeaLeaf != "undefined") && (typeof TeaLeaf.Client != "undefined") && (typeof TeaLeaf.Client.tlAddEvent != "undefined") ) {
                                            var nVO = { ErrorMessage : bnadd_msg_018} 
                                            TeaLeaf.Event.tlAddCustomEvent(subtype, nVO);
                                        }
                                    return false;
                                }
                                //Validate that email address has @ and .
                                if(f.email2 && ( f.email2.value != f.email1.value) && (!editEmail(f.email2.value,'Email Address'))) 
                                {
                                    return false;
                                }
                                if(addrType == atBill)
                                {
    
    
                                    if(f.email2.value != f.email1.value)
                                    {
                                        customAlert ("email2",bnadd_msg_005);
                                        if ((typeof TeaLeaf != "undefined") && (typeof TeaLeaf.Client != "undefined") && (typeof TeaLeaf.Client.tlAddEvent != "undefined") ) {
                                            var nVO = { ErrorMessage : bnadd_msg_005} 
                                            TeaLeaf.Event.tlAddCustomEvent(subtype, nVO);
                                        }
                                        return false;
                                    }
                                    else
                                    {
                                        if(f.email2 && (f.email2.value != f.email1.value) && (!editEmail(f.email1.value,'Email Address'))) 
                                        {
                                            return false;
                                        }
                                        else
                                            return true;    
                                    }
    
    
                                }
    
                            }
                            break;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my form validation does not firing...if i try to submit this form without entering
This is a form validation that will hide the submit button if the input
I am using databinding and IDataErrorInfo style validation in a form. This form includes
I am currently using $.blur(fn();) for form validation, but this only takes effect when
I have a function that contains messages for form field validation. However I would
I have this script uses regular expressions to check that a form field contains
I'm running a update_user form through $user = ORM::factory('user', $id)->update_user($this->request->post(), array( 'username', 'password', 'email'
Update the question Hello All, I would like improve my email address validation code.
I've got my users entering an email address and doing some validation as they
I am designing a registration form in php. i want to add some validation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.