Link to home
Start Free TrialLog in
Avatar of joanna_l
joanna_l

asked on

Preventing SPAM on an online form

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!
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

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

Avatar of joanna_l
joanna_l

ASKER

Hi mplungjan,

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

Many thanks,
Joanna
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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 :)
Sorry, I'll attach the code since I have to have the form working - I'll revert back to the old form.
Here it is!
form.doc
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