Search code examples
javascriptuser-input

Simple & basic form spam reduction: checking for Javascript?


I'm trying to reduce the form spam on our website. (It's actually pretty recent).

I seem to remember reading somewhere that the spammers aren't executing the Javascript on the site.

Is that true? And if so, then could you simply check for javascript being disabled and then figure it's likely that it's spam?


Solution

  • There are still a large number of people that run with Javascript turned off.

    Alternatively, I have had decent success with stopping form spam using CSS. Basically, include an input field and label that is hidden using CSS (display: none;) and once submitted, check if anything has been entered in the field.

    I generally label the field as a spam filter with an instruction to not put anything in the field, but all newer browsers will properly hide the block.

    reCAPTCHA is also surprisingly easy to implement.