Tag: field

How to validate Email Address Using Javascript

<script language=”javascript” type=”text/javascript”> function checkemail(id) { var email = document.getElementById(id); var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; if (!filter.test(email.value)) { alert(‘Please provide a valid email address’); email.focus; return false; } return true; } </script>

Tagged with: , , , ,
Top