diff --git a/browserid/static/dialog/controllers/addemail_controller.js b/browserid/static/dialog/controllers/addemail_controller.js index a4a81093489df778b9d4d700f659b675c862b02d..035b5faff541dce04931d73caf78ad6006e1f9ad 100644 --- a/browserid/static/dialog/controllers/addemail_controller.js +++ b/browserid/static/dialog/controllers/addemail_controller.js @@ -52,6 +52,11 @@ this.find('input:first').attr('checked', true); }, + validate: function() { + var email = $("#email_input").val(); + return /^[\w.!#$%&'*+\-/=?\^`{|}~]+@[a-z0-9-]+(\.[a-z0-9-]+)*$/.test(email); + }, + submit: function() { // add the actual email // now we need to actually try to stage the creation of this account.