• This documentation is valid for:

Download here

The information about Captcha can be found here. Basically, it is a control used to determine whether the user is human. This implementation is based on the sample downloaded from the following link.

CaptchaImage1

Using the control

The control basically has the following properties. One of them is a numeric property to set the validation result.

Captcha User Control Properties
ControlName Name of the control.
Height Height of the control, default 39 according to image size.
ValidationResult Numeric property used to set the validation result.
ReloadImageText Text to be shown as Reload Image link.
Width Width of the control, default 140 according to image size.

 

Methods

ReloadImage : Lets you reload the image displayed by the control without refreshing the page (eg: Captcha1.ReloadImage())

First of all, you need to drag the control from the toolbox where you have the controls and the user controls to a web panel. When you do that, the control will be displayed as follows:

CaptchaDesign

Then, select the control to see its properties.

CaptchaProperties

The following code could be used in your event to know if the validation was successful or not.:

Event 'Register'
  If Captcha1.ValidationResult = 1
     // OK
  Else
     msg("Validation failed, retype the word as seen on the image.")
  Endif 
EndEvent

Control at runtime:

The control will be displayed as follow showing a random image. As you can see, an edit box is created by the control just below the image. There is where the use needs to type the image text and press tab in order to get the validation executed.

CaptchaRuntime

Note: This first version of the control is for illustrative purposes. In further versions the security will be improved, the idea is to have the user control to return the image id and the encrypted text typed by the user so it can then be validated against the values stored in a database table; suggestions are welcomed.

To install it

Please visit: Default Installation Instructions for User Controls.

Change Log

2008/04/26: Version 1.1 uploaded. VersionNumber and PathToImages properties added to the control.
2010/02/15: Version 1.3 uploaded. VersionNumber property removed, ReloadImage method added.
2011/03/07: Version 1.4 uploaded. fix:Some texts had wrong encoded values. feature:ReloadImage link is now displayed allowing user to change current image.
           

Please send feedback to: ncardelino@genexus.com