Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unnitallman/600296 to your computer and use it in GitHub Desktop.
Save unnitallman/600296 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
function validate_contact_admin_form(form_id) {
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
var address = document.forms[form_id].elements['email'].value;
if(reg.test(address) == false) {
alert('Invalid Email Address');
return false;
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment