473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

email validation that will not accept underscore after the @

Hi,
all thanks in advance, i need a help immediately.

i need to create email validation function that will accept no underscore character after the @

Please help. its so urgent
Jul 15 '11 #1
3 2396
Rabbit
12,516 Expert Mod 8TB
Use a regular expression, or if you don't want to do that, you could follow this algorithm:

Find index of the @ character.
Substring out the character after that index.
Check to see if it's an underscore.
Jul 15 '11 #2
Dormilich
8,658 Expert Mod 8TB
or just look if the address contains "@_".
Jul 17 '11 #3
Expand|Select|Wrap|Line Numbers
  1. function CheckEmail() {
  2.             var email = document.getElementById('txtEmail');
  3.             var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/ ;
  4.             if (!filter.test(email.value)) {
  5.                 alert('Please provide a valid email address');
  6.                 return false;
  7.             }
  8.             alert('email address is Ok');
  9.             return true;
  10.         }
this is working fine for me
Jul 21 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Marlon | last post by:
How can modify this expression \w+(\w+)*@\w+(\w+)*\.\w+(\w+)* to validate multiple email address separator by comma and/or semicolon e.g. someone@somedomain.com;someone2@somedomain.com
4
by: VbUser25 | last post by:
Hi Please suggest i think i am doing something wrong. I am calling fucntion test from another function where i am performing all the validations.I want to validate the email id. this is the...
1
by: Jim Dornbush | last post by:
Has anyone seen an updated regex expression from Microsoft for the email validation expression so that single quotes are allowed? I've been using the canned regex for emails, but recently been...
7
by: e_matthes | last post by:
Hello everyone, I've read enough about email validation to know that the only real validation is having a user respond to a confirmation message you've sent them. However, I want to store the...
10
by: ll | last post by:
Hi, I currently am using the following regex in js for email validation, in which the email addresses can be separated by commas or semicolons. The problem, however, lies in that I can type two...
1
by: vimal.424 | last post by:
Hello guys........ please tell me ............. I want to do email validation like i have a userid entered by user new user.so problem is that i have to do the validation when i'll click...
1
by: shwethatj | last post by:
My problem is lik this , I am trying to create a registration form using javascript for a HR website , but i dont know how to provide password validation i.e the password and confirmation password...
1
by: curi444 | last post by:
How can i improve email validation in the code below? <?php $con = mysql_connect("localhost", "root", ""); if(isset($_POST)) { $name=$_POST; $address=$_POST; $phno=$_POST;
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.