diff --git a/ignite-html-validate.js b/ignite-html-validate.js index 5de8e13..4a4ad50 100644 --- a/ignite-html-validate.js +++ b/ignite-html-validate.js @@ -198,9 +198,9 @@ IgniteTemplate.prototype.validate = function (callback) { IgniteTemplate.prototype.validateEmail = function (msg) { return this.validate((value, error) => { if (!value || value.length == 0) { - return error(msg ? msg : `Please enter an email address.`); + return error(msg ? msg : 'Please enter an email address.'); } else if (value.trim().length < 5) { - return error(msg ? msg : `Email address too short.`); + return error(msg ? msg : 'Email address too short.'); } else if (!value.includes('@')) { return error(msg ? msg : 'Email address missing @ symbol.'); } else if (!value.includes('.')) { @@ -209,6 +209,8 @@ IgniteTemplate.prototype.validateEmail = function (msg) { return error(msg ? msg : 'Email address too long.'); } else if (value.includes(' ')) { return error(msg ? msg : 'Email address cannot contain spaces.'); + } else if (value.split('@').length > 2) { + return error(msg ? msg : 'Email address has too many @ symbols.') } }); }