How to add hidden fields to forms?
I've been getting killed with a lot of spam in my add a link, contact me and booking forms on my sites and don't want to use thecaptcha feature.
Someone on myspace told me to add some "hidden" fields in my forms that the bots would fill in. This would then cause my script to reject the form.
My problem is they never told me how to do this. Here's my add a link form code. Can anyone help me out here?
Your Site Title:
Your Website Addrees:
Your Email Address:
Select a Category:
A - B
C - D
E - G
H - J
K - L
M - O
P - R
S - T
U - W
X - Z
Link Description:
<script type="text/css" language="javascript"> makeProgress('content_pbar', document.getElementById('text_desc1'), 2000); </script>
kb posted this at 02:33 — 30th July 2007.
He has: 1,380 posts
Joined: Feb 2002
Type:
Places like Google could have told you this very easily.
TheVoice posted this at 13:14 — 30th July 2007.
They have: 10 posts
Joined: Jul 2007
Thanks for the codes. So will this work the way I've insert the hidden fields below.
Your Site Title:
Your Website Addrees:
Your Email Address:
Select a Category:
A - B
C - D
E - G
H - J
K - L
M - O
P - R
S - T
U - W
X - Z
Link Description:
<script type="text/css" language="javascript"> makeProgress('content_pbar', document.getElementById('text_desc1'), 2000); </script>
kazimmerman posted this at 11:13 — 30th July 2007.
He has: 698 posts
Joined: Jul 2005
What I don't quite understand is that there are already hidden form fields in the original code...
TheVoice posted this at 13:08 — 30th July 2007.
They have: 10 posts
Joined: Jul 2007
I saw those in the code too, but I didn't understand how to make the input box visible to only the bots. I thought there had to be some special coding or words to use.
Just trying to get the hang of coding.
kazimmerman posted this at 13:48 — 30th July 2007.
He has: 698 posts
Joined: Jul 2005
Well, if you are going to use hidden fields like that, you need to realize two things:
1. The fields names should probably be relevant to the form so the bot is drawn to the similar form names.
2. You should actually leave the hidden field values blank so the bot has to fill them in, and rather check for empty fields for legitimate entries.
Kurtis
TheVoice posted this at 14:55 — 30th July 2007.
They have: 10 posts
Joined: Jul 2007
Ok, will this work? and will more then 1 hidden field be required?
kazimmerman posted this at 15:27 — 30th July 2007.
He has: 698 posts
Joined: Jul 2005
It will certainly hold them back, from what I've read. It's not 100% effective, but is anything?
Another way you could go about it would be to use regular text type inputs and use CSS to hide them, something like this, but preferably using a class instead of inline styling.
<input type="text" name="website" style="display:none;" />
but the main problem with that is that if a user has style sheets disabled or their own enabled, your text field may show up.
Kurtis
TheVoice posted this at 18:08 — 30th July 2007.
They have: 10 posts
Joined: Jul 2007
Ok I've added the new code to my addlinks form. I will let you know how it works.
Thanks a million for all of your help.
kazimmerman posted this at 18:44 — 30th July 2007.
He has: 698 posts
Joined: Jul 2005
Not a problem. I would be very interested to find out how well that weeds out spam, even if you need to let me know via PM.
TheVoice posted this at 19:26 — 31st July 2007.
They have: 10 posts
Joined: Jul 2007
Sad but true.......It didn't stop any of them.
I guess I'm going to have to use a captcha script.
Any site suggestions for a nice easy to read by human one to use?
andy206uk posted this at 19:45 — 2nd August 2007.
He has: 1,758 posts
Joined: Jul 2002
Hi,
Just adding the hidden fields to the form isn't going to help on it's own! You have to actually CHECK if the field has been completed in the script that processes the form otherwise you'll achieve nothing.
Andy
kazimmerman posted this at 01:55 — 3rd August 2007.
He has: 698 posts
Joined: Jul 2005
I guess I assumed he knew to do this...
Remember that if they do have a value, it is a bot, and if they are empty, it's a human...
Kurtis
TheVoice posted this at 14:31 — 3rd August 2007.
They have: 10 posts
Joined: Jul 2007
Sorry that I didn't let you all know I wasn't too good at coding.
Can one of you instruct me on how to make the script check the fields and then decide rather or not to process it?
supersam33 posted this at 14:38 — 3rd August 2007.
He has: 32 posts
Joined: Aug 2007
Maybe the spam you are getting isn't from bots, but people who just feel like being jerk-offs...
TheVoice posted this at 13:58 — 22nd August 2007.
They have: 10 posts
Joined: Jul 2007
It's from bots. they are hittting all of my forms. Can someone tell me how to have the codes confirm the fields.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.