Restrict chosen email domains from signing up to your newsletter.
<form method="post" action="https://www.sendsteed.com/subscribe/" target="_blank">
<div class="form-group">
<label for="e11111">Email:</label>
<input name="e111111" type="text" placeholder="[email protected]" id="e11111" required>
</div>
<div class="form-group">
<label for="n11111">Name:</label>
<input name="n11111" type="text" placeholder="Name" id="n11111" required>
</div>
<input type="hidden" name="lllid" value="11111">
<input type="hidden" name="lluid" value="texas">
<input type="hidden" name="redirect" value="">
<input type="hidden" name="source" value="">
<br><button type="submit" class="btn btn-primary float-end">Submit and Check Email</button>
</form>
<script>
window.onload = function() {
document.querySelector('button[type="submit"]').addEventListener('click', function(e) {
var emailField = document.querySelector('#e11111');
var bannedDomains = ['duck.com', 'yahoo.com', 'hotmail.com', 'outlook.com'];
var enteredEmail = emailField.value;
var enteredDomain = enteredEmail.substring(enteredEmail.indexOf('@') + 1);
if (bannedDomains.includes(enteredDomain)) {
alert('Emails from ' + enteredDomain + ' do not work with our system. Your provider blocks legitimate and honest newsletters. Please use a free service such as Gmail if you do not have your own domain email..');
e.preventDefault();
return false;
}
});
};
</script>