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 8104729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:55:59+00:00 2026-06-05T23:55:59+00:00

Hey guys am having a bit of problems with my jQuery, I have all

  • 0

Hey guys am having a bit of problems with my jQuery, I have all the input validations all working, but I cant get my REGEX code working for validating my email. tried entering “hello@mywebsite.co.uk” my personal email and my work email and all of them dont work.

Any help is highly appriciated.

var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  $('.submitbutton').click(function () {
    if ($("input.name").val() == '') {
        alert("Name is a required field");
        return false;
    }
    else if ($("input.email").val() == '') {
        alert("Email is a required field");
        return false;
    }
    else if (!regex.test("input.email")) {
        alert("This is not a valid email address");
        return false;
    }
    else if ($("textarea.message").val() == '') {
        alert("Message is a required field");
        return false;
    }
    else {
        return true;
    }
});

Cheers

  • 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-06-05T23:56:03+00:00Added an answer on June 5, 2026 at 11:56 pm

    In regex.test("input.email"), you’re testing if the actual string "input.email" is matching the regex. Instead, you should test the value of input.email element.

    So use:

    regex.test($("input.email").val())
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hey guys having this really simple problem but cant seem to figure out have
Hey guys I'm having such a hard time of it today. I have a
hey guys, just having a bit of difficulty with a query, i'm trying to
Hey Guys, having an issue with Linq-to-SQL, I am basically doing the following but
Hey guys, working on an event calendar. I'm having some trouble getting my column
Hey guys, I'm brand new to Visual C++, but not C++. I'm having issues
Hey guys, thanks in advance for any help or input. I am having trouble
Hey guys and gals I'm having some major issues trying to get my application
Hey guys I'm trying to work my way through this but am having an
Hey guys, I'm having problems with the ItemContainerGenerator in Silverlight 3. In my derived

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.