JS Spambot protection

[code]

For a quick and dirty fix, Mike, you might try something like this on 
one of your inputs:

<script type="text/javascript" language="javascript">
function makeHuman(input,element){
if(!document.getElementById("ishuman")){
var formText = element.innerHTML;
var ivalue = input.value;
var iid = input.getAttribute("id");
var hinput = "<input type=\"hidden\" name=\"ishuman\" id=\"ishuman\" 
value=\"true\"\/>";
element.innerHTML = formText+hinput;
//Need to rewrite the blurred field value since the blur event doesn't 
set the DOM value
document.getElementById(iid).value = ivalue;
};
};
</script>
<input type="text" name="myinput" id="myinput" value="" 
onblur="makeHuman(this,this.parentNode);"/>

this will use javascript to write a hidden input in the form.   Then 
you can validate your form by wrapping your logic with:

<cfif structKeyExists(form,"ishuman")  and form.ishuman>

[processing code here]

</cfif>

This will take care of everything but direct input by a person in a 
javascript enabled browser.  For better results, you place the script 
in one of your site .js files.  As was said earlier, sometimes the 
spammers use a human to capture the form values an then plug it in to 
their software for spamming runs.

[/code]

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
© 2007 MJ Frauenheim, all rights reserved.