Commit 9752d72e authored by Jennifer "JJ" Cordz's avatar Jennifer "JJ" Cordz

modify email domain accepted

parent 8f83a7f0
Pipeline #59221329 passed with stages
in 27 minutes and 41 seconds
......@@ -44,6 +44,9 @@ extra_css:
%form#mktoForm_1754
:javascript
MktoForms2.loadForm("//page.gitlab.com", "194-VVC-221", 1754, function(form) {
// Please include the email domains you would like to block in this list
var invalidDomains = ["@qq.","@163.","@126."];
form.onSuccess(function() {
// show demo video
document.getElementById('video-container').style.display = 'block';
......@@ -57,4 +60,29 @@ extra_css:
dataLayer.push({event: 'demo', mktoFormId: form.getId()});
return false;
});
form.onValidate(function() {
var email = form.vals().Email;
if (email) {
if (!isEmailGood(email)) {
form.submitable(false);
var emailElem = form.getFormElem().find("#Email");
form.showErrorMessage("Please use a business email, this is not an accepted email domain.", emailElem);
} else {
form.submitable(true);
}
}
});
function isEmailGood(email) {
for(var i=0; i < invalidDomains.length; i++) {
var domain = invalidDomains[i];
if (email.indexOf(domain) != -1) {
return false;
}
}
return true;
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment