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

  • Home
  • SEARCH
  • 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 5934045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:03:31+00:00 2026-05-22T15:03:31+00:00

Update the question Hello All, I would like improve my email address validation code.

  • 0

Update the question

Hello All,

I would like improve my email address validation code. Currently, we have 6 different email address

var emailPatt=/@(tomtom|stream|teleperformance|htc.teleperformance).com/i;
var emailPattUS2=/@(teleperformance).com/i;
var emailPattUS3=/@(hispanic).corp/i
var emailPattUS4=/@(htc).to/i

As you see, there are 4 variables, when users’ email address have emailPatt2, emailPatt3, emailPatt4, it will send to “profil2” page. For emailPatt except “htc.teleperformance.com” will go to profile page

// For // Tomtom.com and stream.com email address will redirect to profile page
//Htc.to, Htc.teleperformance.com, Teleperformance.com, Hispanic.corp will go to prolfe2 page. 


else if(emailPattUS2.test(eo.data.username)|| emailPattUS3.test(eo.data.username)|| emailPattUS4.test(eo.data.username)) //If the email is teleperformance.com
            {document.location.href="/app/account/profile2";}
                else
                    {document.location.href="/app/account/profile";}
                },

In the main login process code:

**// If login's email address is one of these: 
// Tomtom.com
//Stream.com
//Htc.to
//Htc.teleperformance.com
//Teleperformance.com
// Hispanic.corp
// then Login code will fire event (loginFormSubmitRequest) , it will check email address //and password in dataase

if(emailPatt.test(eo.data.username)|| emailPattUS3.test(eo.data.username)||emailPattUS4.test(eo.data.username)) //Search the regualr expres between string
    {
       // alert("test works");
        RightNow.Event.fire("evt_loginFormSubmitRequest", eo);
        new YAHOO.util.Anim("rn_" + this.instanceID + "_Content", { opacity: { to: 0 } }, 0.5, YAHOO.util.Easing.easeOut).animate();
        YAHOO.util.Dom.addClass("rn_" + this.instanceID, 'rn_ContentLoading');

       //since this form is submitted by script, force ie to do auto_complete
        if(YAHOO.env.ua.ie > 0)
        {
        if(window.external && "AutoCompleteSaveForm" in window.external)
        {
            var form = document.getElementById("rn_" + this.instanceID + "_Form");
            if(form)
            window.external.AutoCompleteSaveForm(form);
        }
        }
        return false;
    }

// When the email address is not from the list, they will not fire login event. throw
//error message.
//
//
    else if(!emailPatt.test(eo.data.username)|| !emailPattUS3.test(eo.data.username)||!emailPattUS4.test(eo.data.username))
    {
       //alert(emailPatt.test(eo.data.username));
       // alert ("not tomtom email address");
        me._onLoginResponse("evt_loginFormSubmitResponse", [{
        w_id : eo.w_id,
        result : 0,
        message : RightNow.Interface.getMessage('EMAIL_IS_NOT_VALID_MSG')
        }]);
    }

    },

That is quit not optimize at all. I am wondering whether there is dictionary list i can use to look though all the email address in here. It will a bit clean and fast for the system .

Thanks

  • 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-22T15:03:32+00:00Added an answer on May 22, 2026 at 3:03 pm

    A page about validating email-addresses using regexps http://www.regular-expressions.info/email.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.