Ezilon.com - Target Your Audience, be Seen in Your Region

How to add hidden fields to forms?

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.

They have: 10 posts

Joined: Jul 2007

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>

 

brady.k's picture

He has: 1,383 posts

Joined: Feb 2002

Type:

Places like Google could have told you this very easily.

Kyle Brady, President, Intuitive Industries LLC.
http://www.int-ind.com
[EMAIL=brady.k@gmail.com]brady.k@gmail.com[/EMAIL] - [EMAIL=brady.kyle@int-ind.com]brady.kyle@int-ind.com[/EMAIL]

They have: 10 posts

Joined: Jul 2007

brady.k;222346 wrote: Type:

Places like Google could have told you this very easily.

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>

 

mscreashuns's picture

He has: 546 posts

Joined: Jul 2005

TheVoice;222344 wrote: ...

...

What I don't quite understand is that there are already hidden form fields in the original code...Confused

They have: 10 posts

Joined: Jul 2007

mscreashuns;222360 wrote: What I don't quite understand is that there are already hidden form fields in the original code...Confused

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.

mscreashuns's picture

He has: 546 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.

They have: 10 posts

Joined: Jul 2007

Ok, will this work? and will more then 1 hidden field be required?

mscreashuns's picture

He has: 546 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.

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.

mscreashuns's picture

He has: 546 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. Wink

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's picture
DeveloperModerator

He has: 1,742 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.

Andyk

Music Rants News and Reviews | My Photoblog | Blog of a Web Designer
Give a man a fish and you feed him for a day. Teach him to use the Net and he won't bother you for weeks.

mscreashuns's picture

He has: 546 posts

Joined: Jul 2005

andy206uk;222569 wrote: 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.

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...

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's picture

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...

The statement below is true.
The statement above is false.

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.