Here is a simple addition to the web forms that add honeypot anti-spam functionality to prevent spambots without an ugly captcha.
What is honeypot anti-spam?
As of now, spambots cannot handle javascript, and we exploit this point to add extra fields to your forms using javascript as an anti-spam checker. Since spambots cannot see that field, we check if that field exists. If that field doesn’t exist, we will block spam submission.
How does it work?
The principle of a honeypot is simple — bots are stupid. Somewhat they blindly fill in fields, regardless of whether the field should be filled in or not. This is how a honeypot catches the bot — it introduces an additional field in the form that will cause the form not to validate if filled out.
Note: You can even use this case in the server action to prevent the spam entries in Database.
Updated component with web-block UI.