Captcha

Posted: May 28, 2012 in Java Scripts

SIMPLE FORM

</script>

<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;} else
{alert (“Enter Valid Captcha”);
return false;
}

}

</script>

 

HTML

<form name=”form2″ id=”form2″ method=”post” action=”contact.php” onsubmit=”validate(this); return ValidBotBoot();” >

<div>
<div style=”margin:0px; padding:0px 10px;”>Please Enter Valid Captcha:  </div>
<div style=”padding:10px 0 30px 0; font-size:14px; color:#000;”><script type=”text/javascript”>DrawBotBoot()</script>
<input id=”Button1″ value=”Check” type=”hidden” name=”captchacode”/></div>
</div>

 

 

 

=============================================================================================

POP-UP FORM

<script type=”text/javascript”>
var a = Math.ceil(Math.random() * 10);
var b = Math.ceil(Math.random() * 10);
var c = a + b;
function DrawBotBoot2() {
document.getElementById(“span1”).innerHTML = “<br><br> What is “+ a + ” + ” + b +”? “;
document.getElementById(“BotBoot”).style.display=”block”;
}

function ValidBotBoot2() {
var d = document.getElementById(‘BotBootInput2’).value;
if (d == c) {return true;} else
{alert (“Enter Valid Captcha”); return false}
}

</script>

 

 

HTML

<form name=”form2″ id=”form2″ method=”post” action=”discount.php” onsubmit = “validate(this); return ValidBotBoot4()”>

<tr>
<td><p>Please Enter Valid Captcha:</p></td>
<td><script type=”text/javascript”>DrawBotBoot4()</script><div id = “BotBoot2″ style=”display:none; margin:-35px 0 0 10px; color:#fff; padding:0px;”>
<span id = “span3”></span>
<input id = ‘BotBootInput4′ type=’text’ maxlength=’2′ size=’2’/>
</div></td>
</tr>

Advertisements
Comments
  1. Woh I like your content , saved to my bookmarks ! .