I am putting validation on email field but it shows error of invalid even where the email is typed in correct format.
Code
<script type="text/javascript"> function formvalidate(){ var email=document.signup_form.email.value; var check_email= RegExp("^[A-Z0-9._-]+@[A-Z0-9.-]+\.[A-Z0-9.-]+$"); if(email=="") { alert("cannot be empty!"); document.signup_form.email.focus(); return false; } else if(!check_email.test(email)) { alert("enter valid email address!"); document.signup_form.email.focus(); return false; } else { return true; } } </script> Thanks
[email protected]/.@...are valid emails