A simple javascript client side validation script to find out if the person entering the site and submitting the form is user or machine or bot or some xyz. its small handy effective script which if passes validtion will give u reply true or else if wrong reply or left blank will give u false reply. Till then the form wont be processes further.
<html>
<head>
<title>BotBoot</title>
<script type="text/javascript">
var a = Math.ceil(Math.random() * 10);
var b = Math.ceil(Math.random() * 10);
var c = a + b
function DrawBotBoot()
{
document.write("What is "+ a + " + " + b +"? ");
document.write("<input id='BotBootInput' type='text' maxlength='2' size='2'/>");
}
function ValidBotBoot(){
var d = document.getElementById('BotBootInput').value;
if (d == c) return true;
return false;
}
</script>
</head>
<body>
Are you human?<br />
<script type="text/javascript">DrawBotBoot()</script>
<input id="Button1" type="button" value="Check" onclick="alert(ValidBotBoot());"/>
</body>
</html>
0 comments:
Post a Comment