Thread: combat spam
View Single Post
  #21 (permalink)  
Old 05-21-2008, 12:16 PM
littlegiant's Avatar
littlegiant littlegiant is offline
WebProWorld Pro
 
Join Date: Jan 2004
Posts: 190
littlegiant RepRank 1
Default Re: combat spam

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.
Reply With Quote