It’s always a great feeling to get leads through your website. However it is a bit demotivating when you go to review the lead and you realize it’s SPAM! I noticed we were getting 1-2 “leads” daily around 3-4 AM, with the company name often being ‘Ranks India’. I realized the only way to block this automated spam filling out the form was to disable the submit button if the company name matches a pre-defined string.
Here is a hack that I coded in jQuery to reduce the amount of spam leads we’re receiving in our Salesforce dashboard. As you can see, when the company input (tagged as id=’company’) has something inputted (eg. keyup) it activates the function. Then it checks the value and if it matches Ranks India or a2zesolutions.com it disables the submit button. See below for the jQuery code. This needs to be placed between the <head> and </head> tags on your contact form (or landing page.)
<script type="text/javascript"> $( "#company" ).keyup(function() { var value = $( this ).val(); if(value == 'Ranks India' || value == 'a2zesolutions.com') { $('input[type="submit"]').attr('disabled','disabled'); } }) .keyup(); </script>