Quick Search:
 JavaScript: Anti-Bot Form Code Jump to:  
Category: >> JavaScript >> Anti-Bot Form Code  

<< 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)

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>

   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org