Monday, April 28, 2008

How To Validate Email Id Using JavaScript

String.prototype.ValidateEmail = function (evt)
var eVal = new RegExp("\\w+([-+.\’]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");
var chkVal = eVal.exec(this);
if(chkVal != null)
alert('Id Correct');
alert('Check Your Id');
<input type="text" id="txtEmail" width="30px" onblur="this.value.ValidateEmail();" />

No comments:

Creative Commons License
Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.