Category: >> JavaScript >> Anti_Bot Form Code Bookmark and Share

<< lastnext >>

Snippet Name: Anti_Bot Form Code

Description: In this example, the action of the form is not set until the user clicks on submit. I believe this should foil most bots. The javascript can easily be obfuscated to make it even more difficult for a bot to do its dirty work.

Comment: (none)

Author: CoderZone
Highlight Mode: JAVASCRIPT
Last Modified: February 27th, 2009

<script type="text/javascript">
     function submit1(){
     var o=document.getElementById("form1");
<form id=form1>
<tr><td>First Name:</td><td><input name=fname></td></tr>
<tr><td>Last Name:</td><td><input name=lname></td></tr>
<tr><td>Email Address:</td><td><input name=email></td></tr>
<input type=button onclick="submit1();" value=Submit>
Add a comment 
EdMay 2nd, 2013 12:11pm
Cool idea, and it WORKS!
© | users online: 10