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 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 == '') {



The following two tabs change content below.

Brock Murray

Co-Founder/COO at seoplus+
Brock Murray the co-founder and COO at seoplus+. He has had great success in helping hundreds of local, national and international businesses to establish, maintain, and increase their online presence with the goal of brand awareness and multi-channel lead generation.