i am using vtiger and recieveing alot of spam on the website contact page i am using this code
Add an extra field to the form that you do not use. Hide it with css.
Spam bots visiting the page will fill all fields, even if they are not shown.
If there's something in the hidden field, the whole form is spam, and you can discard the data.