Return to Snippet

Revision: 50438
at August 22, 2011 00:27 by alberomo


Initial Code
function isEmail(field) {
  if (field.value.indexOf("@") == -1 || field.value.indexOf(".") == -1) {
    return false;
  } else {
    return true;
  }
}

Initial URL

                                

Initial Description
Check if user has intruded a real email address. Return true (real email) or false (fake email).
Arguments: Element from a form.
From book Dom Scripting by Jeremy Keith

Initial Title
isEmail Function

Initial Tags
javascript, DOM, validation

Initial Language
JavaScript