You can customize captcha-image by next parameters:

Parameter name Default value  Example Description
Captcha_Type 2  1 1 or 2
Captcha_Length 5  4 from 1 to any number (length of captcha code)
Captcha_CharacterSet 234567890  ACDEFGHJKLMNPQRSTUVWXY any characters (characters of captcha code)
Captcha_ImageWidth 200  300 from 1 to any number
Captcha_ImageHeight 70  100 from 1 to any number
Captcha_BackGroundColor white  #7b4f9d named color (green, red) or HEX-color (#0000FF, #FF00FF)
Captcha_FontColor blue  #b8d544 named color (green, red) or HEX-color (#0000FF, #FF00FF)
Captcha_WarpFactor 1.6  2,2 1.0 - 3.0
Captcha_Fonts Times New Roman, Georgia, Arial, Comic Sans MS, Courier  Arial,Verdana comma-delimited list of any named fonts
Captcha_UseBackGroundImage false  true true (yes) or false (no)
Captcha_BackGroundImageBasePath -  /Cms_Data/Contents/Sample-Site/Media/captchabg/ URL to folder with captcha backgrounds
Captcha_BackGroundImagePath -  cp2.jpg,cp3.png comma-delimited list of captcha backgrounds
Captcha_ReloadLinkText Reload captcha  Load another code any text
Captcha_IncludeUserInfo true  false true or false
Captcha_MailSubject FeedBack from site <site name>  Order form any text
Captcha_FieldsForValidation -  username,email comma-delimited list of name of form fields
Captcha_ValidationMessage {0} not correct  {0} is required any text ({0} will be replaced by name of field)
Captcha_eMailForFeedBack if empty, e-mail is taken from SMTP settings, comma-delimited list of e-mail for feedback message

How to use

If you want to use this parameters, you need to add them on your view:

add parameter

You can add only parameter you need:

After it you need to set this parameters on page when you insert a view on it:

You can set different parameters on different pages, if you use several captcha forms.

If you want to use the same parameters on all pages and all captchas on your site, you can set this parameters like Custom fields (in Site Settings) instead of to set them in view:

About some parameters

You must set all parameters without quotes.

1) Captcha_Type

Values: 1 or 2

Type 1 -   Type 2 -

2) Captcha_WarpFactor - distortion factor of captcha code (only type 1).

3) Captcha_IncludeUserInfo. Only on feedback-form. If true, user information (IP, Agent) will be include into letter.

4) Captcha_FieldsForValidation and Captcha_ValidationMessage. This parameters work only on feedback-form.

For validation your form you can use default validation in kooboo (for example: data-val-required="Title is required" data-val="true"). But in IE6-8 it's not working. You can use parameters - Captcha_FieldsForValidation and Captcha_ValidationMessage.

If you use "Captcha_FieldsForValidation" and "Captcha_ValidationMessage", plugin will validate fields you write ("required validation") and return to you message that you write in "Captcha_ValidationMessage".
For example, you want to validate field "name". You must write it in  "Captcha_FieldsForValidation" parameter. Also you set the "Captcha_ValidationMessage" parameter like "{0} is required". And then you can insert this message (@ViewData["name"]) into your view:

<input type="text" id="name" name="name" /> @ViewData["name"]

If user submit empty data, he'll see:

Last edited Jan 13, 2013 at 6:50 PM by EllaSea, version 10


No comments yet.