| Type in your username: |
Javascript CAPTCHACAPTCHA 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()
It is instantiated after the page loads in order to write the keyboard, and set up the handlers:
ClassKeyboard.getKeyboardHTML() ClassKeyboard.getTextTyped() ClassKeyboard.setInstanceName() ClassKeyboard.setObjDisplayNode()
var myClass;
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.function pageStartup() { myClass=new ClassKeyboard(); myClass.setInstanceName("myClass"); myClass.setObjDisplayNode(document.getElementById("nameDisplay")); document.getElementById("keyboard").innerHTML=myClass.getKeyboardHTML(); } //endFunction 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. |