Thread: combat spam
View Single Post
  #22 (permalink)  
Old 05-21-2008, 12:21 PM
z28com z28com is offline
WebProWorld Member
 

Join Date: Aug 2007
Posts: 37
z28com RepRank 0
Default Re: combat spam

Quote:
Originally Posted by littlegiant View Post
I killed spam dead on my feedback form by using Javascript to write out a hidden input:

<script type="text/javascript">
<!--
document.write('<input type=\"hidden\" name=\"xyzxyzxyz\" value=\"test\">');
// -->
</script>

Then I made that hidden input a required field in the script that processes the form.

Then I used Javascript to write out the Submit button.

<script type="text/javascript">
<!--
document.write('<input type=\"submit\" value=\"Submit\">');
// -->
</script>
<noscript>Javascript must be enabled to submit this form.</noscript>

Boom. No more spam.

Not going to win any awards for accessibility (since Javascript must be enabled to submit the form) but it worked.
That's an awesome idea for forms. I will have to start putting that on some of mine. Thanks for that tip.
Reply With Quote