Demo of Javascript Captcha
Home

Type in your username:
UserName:

Javascript CAPTCHA


CAPTCHA is the name for those safety measures designed to prevent robots from repeatedly attempting to log into a website. Usually they take the form of an image that is shown to the user. The user then has to type some letters into a form.

This is a form of "captcha" that is driven by a Javascript-Bean. The bean is totally encapsulated, with five publicly accessible methods:
ClassKeyboard.doKeyHandle()
ClassKeyboard.getKeyboardHTML()
ClassKeyboard.getTextTyped()
ClassKeyboard.setInstanceName()
ClassKeyboard.setObjDisplayNode()
It is instantiated after the page loads in order to write the keyboard, and set up the handlers:
var myClass;

function pageStartup()
{
myClass=new ClassKeyboard();
myClass.setInstanceName("myClass");
myClass.setObjDisplayNode(document.getElementById("nameDisplay"));
document.getElementById("keyboard").innerHTML=myClass.getKeyboardHTML();
}
//endFunction

What it does is deliver a keyboard where each row of keys is randomly scrambled. The user has to have human intelligence in order to input his data.

You can try by inserting data, and then submit the form. A cgi will show your input. You can also reload the keyboard to watch its random arrangement.