Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am doing validations using j query.After '@' i don't want accept numbers.When user enter the numbers i want to replace that number.How to do that.Give some suggestions.
Posted

1 solution

Hi deepthi,

U dont want the numbers after @ symbol rite ...i hope this will work try this....

C#
$(document).ready(function() {
  $('#txtEmail').blur(function() {
      if(validateEmail('txtEmail'))
      {
          alert('Email is valid');
      }
      else
      {
          alert('Invalid Email Address');
      }
   });
});
function validateEmail(txtEmail){
   var a = document.getElementById(txtEmail).value;
   var filter = /^[a-zA-Z0-9._-]+@[a-zA-Z.-]+\.[a-zA-Z]{2,4}$/;
    if(filter.test(a)){
        return true;
    }
    else{
        return false;
    }
}
 
Share this answer
 
Comments
Deepthi.T 11-May-12 23:53pm    
when user enter numbers after @ symbol it should not show.How can i do that

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900