Javascript - Email Validation (Non-Regex)

function ValidateEmail(emailAddress) { var x = emailAddress; var atpos = x.indexOf("@"); var dotpos = x.lastIndexOf("."); if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) { return false; } else { return true; } }
- Checks if a email is valid in javascript without using Regex, returns true if valid and false if not

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.