By clicking “Accept all”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Cookie Policy for more information.
// EMAIL DOMAINS TO BLOCK
var emailList = /@(mail\.ru)\s*$/
// ALERT MESSAGE TO BE SHOWN
var emailAlert = 'Sorry, your email domain is not supported.'
// VALIDATion
$('input[type=submit]').click(function() {
$("input[type=email]").each(function() {
var email = $(this).val().toLowerCase();
if (emailList.test(email)) {
(this).setCustomValidity('');
} else {
(this).setCustomValidity(emailAlert);
}
})
});
// PREVENTS ALERT FROM APPEARING WITH EACH KEYPRESS
$('input[type=email]').on('input', function() {
(this).setCustomValidity('');
});