Focus

This is the blog for my web design, development and marketing company, Red Kite Creative. Mostly what I'll be writing about is work-related but anything is fair game. Read more about me here...


View Debbie Campbell's profile on LinkedIn

What I'm Reading



View my bookstore













Avoiding form spam

January 31st, 2007 by debbie campbell

I have a long quote form on my website. Lately, just in the past week, I’ve received about 5 emails from this form with nothing filled in except a big list of porn links or other obnoxiousness in the comments box. I’m running this on FormMail and do have required fields set up but apparently that’s very easy to get around.

I’m in the process of improving my JavaScript knowledge and had recently done a tutorial about form validation, so I applied that knowledge this morning.

In my quote form I inserted this into the <head> section of my php page:

I made my form name ‘form1′ and added this to the <form> tag:

onsubmit="return validate();"

I uploaded it and tested it. Now when someone fails to fill in one of the fields listed above they get a popup box and it doesn’t let them continue.

I know this might not be effective (what happens if they have popups turned off?) but it might enough to dissuade a casual form saboteur, maybe? If it continues to happen I’ll take further action and keep you posted.

Posted in Botheration, Security, Web Design |

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment a bit. Please stay on topic. If you submit spam or irrelevant comments, it will be deleted and your IP will be banned.