Posted By

laxman2021 on 11/23/12


Tagged

email php validating


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

gecube


Validating email


 / Published in: PHP
 

URL: http://katharnavas.wordpress.com/2009/10/20/email-validation-using-php-and-javascript/

This is a script for a validating Email.

  1. ----------------------------------------------------------------------------------------------
  2.  
  3. function callEmailCheck() {
  4. 2
  5. var emailreg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
  6. 3
  7. //useremail is the name of the email text field.
  8. 4
  9. var email = document.getElementById("useremail").value;
  10. 5
  11. if(emailreg.test(email) == true){
  12. 6
  13. return email;
  14. 7
  15. }
  16. 8
  17. return "";
  18. 9
  19. }
  20.  
  21.  
  22.  
  23. -----------------------------------------------------------------------------------------------

Report this snippet  

You need to login to post a comment.