@SanfordWhiteman
Hi Sanford,
This part is still confusing to me " Include that script with a <script> tag, then you can refer to that large array as your freemail domains." do you mean the URL of the .js file in Design studio so code would now be like this? I assume this is incorrect but in reading back through this topic string I a not sure what script you are referring to with "include that scriptp
sorry, there has been so much within this topic I have gotten a bit lost:)
script>
function inDomainList(email, domains) {
return domains.map(function(domain) {
return new RegExp('@' + domain.replace('.', '\\.') + '$', 'i');
}).some(function(reDomain) {
return reDomain.test(email);
});
}
MktoForms2.whenReady(function(form) {
var freemailDomains = ["yahoo.com", "hotmail.com", "live.com", "aol.com", "msn.com", "outlook.com", "gmail.com"],
errorFreemail = "Must be Business email."; /* no need to touch below this line */
var formEl = form.getFormElem()[0],
emailEl = formEl.querySelector("input[name='Email']"),
emailJq = MktoForms2.$(emailEl);
form.onValidate(function(native) {
if(!native) return;
var currentValues = form.getValues(),
currentEmail = currentValues.Email;
if(inDomainList(currentEmail, freemailDomains)) {
form.submittable(false);
form.showErrorMessage(errorFreemail, emailJq);
} else {
form.submittable(true);
}
});
});
</script>
<script>
https://info.lacework.com/rs/016-ATL-295/images/freetxt.js
</script>
</body>
... View more