Click here to Skip to main content
15,900,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
me have an email textfield and passwrd textfield
i want to email take only those value which is suitabl for email address like yahoo email
and password
my english are not so well but i think u understand my question
Regar Mian Sahib jan
Posted
Comments
Tom Marvolo Riddle 9-Apr-14 5:06am    
Do you want to check the emailid provided by user is exist or not?
Mian Sahib Jan 9-Apr-14 5:36am    
no i want what type of value emial textfield accept .only acept those value which is sutible for emial txtfield
Tom Marvolo Riddle 9-Apr-14 5:46am    
Like this asasdasd@gmail.com?

Hi,

use this javascript

C#
function checkEmail() {

    var email = document.getElementById('txtEmail');
    var emailFormat = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

    if (!emailFormat.test(email.value)) {
    alert('Invalid Email');
    email.focus;
    return false;
 }


Good Luck
 
Share this answer
 
You can achieve this by Regular Expression validator

See this:
RegularExpressionValidator In ASP.NET[^]
 
Share this answer
 
Comments
Mian Sahib Jan 9-Apr-14 6:02am    
thanks alot this work properly for me again thanks alot Jas 24

Regard Mian Sahib Jan
Tom Marvolo Riddle 9-Apr-14 6:04am    
You're most welcome!

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