Is there a way to require form submissions to NOT use personal email addresses (those from gmail.com, outlook.com and other domains)?
I am getting a lot of spam even with Recaptcha. They all are coming from gmail.com or outlook.com domains.
Thanks
Is there a way to require form submissions to NOT use personal email addresses (those from gmail.com, outlook.com and other domains)?
I am getting a lot of spam even with Recaptcha. They all are coming from gmail.com or outlook.com domains.
Thanks
Hi Andrey, welcome to the forum
You will have to use custom code for that.
Something like that:
<script type="text/javascript">
$(document).ready(function(e) {
$('#submit-button-id').click(function() {
var email = $('#email-field-id').val();
var reg = /^([\w-\.]+@(?!gmail.com)(?!yahoo.com)(?!hotmail.com)(?!yahoo.co.in)(?!aol.com)(?!abc.com)(?!xyz.com)(?!pqr.com)(?!rediffmail.com)(?!live.com)(?!outlook.com)(?!me.com)(?!msn.com)(?!ymail.com)([\w-]+\.)+[\w-]{2,4})?$/;
if (reg.test(email)) {
return 0;
} else {
alert('Please Enter Business Email Address');
return false;
}
});
});
</script>
Hi Aviv,
Thanks for your help.
Can this code be added in the Webflow UI (I am not developer)?
Perhaps via the Custom Attributes section in the text field setting of the email formâŚ
Thanks, Andrey
@akisselev, this code can be placed on the page where your form is at or under the custom code section of your Page Settings.
This would not be an attribute on the form. Since you are specifically telling the form to reject certain email extensions.
Hope that helps,
Brandon
Hi there Avivtech,
This looks like something I need as well. Is there a way to modify that script so that the form only allows a select few extensions, rather than list all the extensions we donât want to let through?
Cheers
Grant
Hey @grantsenior,
Yea, change the long VAR line with all the email domains to a shorter one.
Check this out:
@QA_Brandon @avivtech Hey Guys, I tried the code by adding it to an existing form and it doesnât work for some reason. I tried pasting it in the head section, body section as well as matching the fields/submit idâs with the ones on the code. No luck, what could be gone wrong?
I wonât be able to really debug the problem without a read-only link and a link to the published siteâŚ
@avivtech Hey man, for some reason I was missing a letter in the ID name, so that part is fixed now.
Is there a way to show the alert message using the Webflow default error message area, instead of using the browser default alert message box?
Yes, but it is a completely different function⌠Youâll have to use something else then the âalertâ method.
@avivtech So basically using the same script blocking personal emails like gmail, but uses Webflow default Error and Success with that script. Any changes to be made to that JS script? Your help is highly appreciated
<script type="text/javascript">
$(document).ready(function(e) {
$('#submitform').click(function() {
var email = $('#email').val();
var reg = /^([\w-\.]+@(?!gmail.com)(?!yahoo.com)(?!hotmail.com)(?!yahoo.co.in)(?!aol.com)(?!abc.com)(?!xyz.com)(?!pqr.com)(?!rediffmail.com)(?!live.com)(?!outlook.com)(?!me.com)(?!msn.com)(?!ymail.com)([\w-]+\.)+[\w-]{2,4})?$/;
if (reg.test(email)) {
return 0;
} else {
alert('Please Enter Business Email Address');
return false;
}
});
});
</script>
Not sure what is the question
@avivtech Sorry for the confusion
My question is: Can you point out what should I do to use the same âblocking gmail scriptâ and have webflowâs default message showing the error message instead of using the browser default alert message box?
@avivtech I thought Itâs not complicated and will be solved by only changing the âalertâ method to something else that will trigger webflowâs error message to show that instead of the browser one. Thanks man!
Trying to use this script too and I cannot get it to work either.
Script is currently active on my frontpage and Iâve tried blocking the domain âurhen.comâ.
Hereâs a read only link
Any idea what might be going wrong?
Oh man, I really hoped this silly mistake of my own was all I had to fix. Unfortunately it didnât seem to do the trick :-/