We help IT Professionals succeed at work.

Preventing SPAM on an online form

joanna_l
joanna_l asked
on
233 Views
Last Modified: 2011-10-19
Hi everyone,

   I recently created a simple HTML form and now I'm getting spam submissions. Is there a way to prevent this without using a Captcha script? One suggestion I've read is to put a hidden field in the form to make the bot work extra hard? I'm not exactly sure how to do this....any ideas? :)

Many thanks!
Comment
Watch Question

Michel PlungjanIT Expert
CERTIFIED EXPERT
Top Expert 2009

Commented:
I use a button - seems to help - by the way NEVER call anything in a form name="submit"
if you want to programatically submit the form you will not be allowed
I removed your name and changed to id="submitButton"
<form action="pleaseenablejavascript.html">
.
.
.
<input type="button" onClick="this.form.action='/Eyecarereviewform.php'" 
id="submitButton" style="height: 50px; width: 200px;" value="Submit Online Survey"/>
</form>

Open in new window

Author

Commented:
Hi mplungjan,

   Thanks for getting back to me :) So if I make these changes it will help prevent the spam?

Many thanks,
Joanna
IT Expert
CERTIFIED EXPERT
Top Expert 2009
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Hi mplunjan,

I tried inputting the code you provided and my form doesn't submit anymore. This is the form I am trying to get to work with your code: http://www.eyecarereview.ca/sampleform.htm 

Thanks again :)

Author

Commented:
Sorry, I'll attach the code since I have to have the form working - I'll revert back to the old form.

Author

Commented:
Here it is!
form.doc
Michel PlungjanIT Expert
CERTIFIED EXPERT
Top Expert 2009

Commented:
SO sorry - I forgot to actually submit the form -  the
this.form.submit()
will do that (but ONLY if you do NOT call the button submit)



<input type="button" 
onClick="this.form.action='/Eyecarereviewform.php'; this.form.submit()" 
id="submitButton" style="height: 50px; width: 200px;" value="Submit Online Survey"/>

Open in new window

Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.