javascript - jquery regexp email validation -


possible duplicate:
how use regular expression validate email addresses?

i have tried standard options, none have helped email: blablabla-k@kiev.foxtrot.ua

client function custom validator in asp.net webforms:

function requiredfields(source, args) {                  var reg = new regexp('/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-za-z\-0-9]+\.)+[a-za-z]{2,}))$/');                  var email = $('#tbemail').val();                 args.isvalid = ((email.length > 0) && (reg.test(email)));  } 

<script type="text/javascript"> $(document).ready(function() {   $('#txtemail').blur(function() {   if(validateemail('txtemail'))   {       alert('email valid');   }   else   {       alert('invalid email address');   }  }); }); function validateemail(txtemail){    var = document.getelementbyid(txtemail).value;    var filter = /^((\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*?)\s*;?\s*)+/; if(filter.test(a)){     return true; } else{     return false; } } </script> 

email address:

< input type='text' id='txtemail' /> 

for live demo click here1


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -