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>

 

 

Share on Google+Share on FacebookTweet about this on TwitterShare on LinkedInPin on PinterestShare on StumbleUponShare on RedditDigg thisShare on TumblrBuffer this pageEmail this to someone
The following two tabs change content below.

Brock Murray

Director of Web Marketing at seoplus+
Brock Murray is a web marketing specialist for seoplus+. He has more than a decade of experience with web design, web programming and online marketing. He has had great success in helping hundreds of businesses establish an online presence with the goal of increasing both brand recognition and targeted website traffic.