Captcha FAQ

How to find out which version of BotDetect ASP.NET CAPTCHA I currently use on backend?

Here are some following ways that can help you:

  • Right-click the assembly, click properties, then click the Details tab. The property "Product version" and "File version" have the assembly version formatted as major.minor.build#.revision#.
  • If you use BotDetect from the GAC, locate to the path C:\windows\assembly. This will bring up a folder that shows installed BotDetect component. Right-click on the assembly and check its properties.

How to find out which version of BotDetect Java CAPTCHA I currently use on backend?

Use the following method to get version of BotDetect Java CAPTCHA you run:

SimpleCaptcha.getLibInfo(); 

How to find out which version of BotDetect PHP CAPTCHA I currently use on backend?

Use the following method to get version of BotDetect PHP CAPTCHA you run:

echo SimpleCaptcha::LibInfo(); 

We have JavaScript-based frontend (jQuery, Angular, React, ...) and we would like to set the locale dynamically on a client side rather than hard coding it on the server side. How to read the locale from our request parameter and change the Captcha locale dynamically?

When you need to support different locales in the same form, you'll need to define the new Captcha style (in botdetect.xml) for each supported locale.

When visitor changes locale on a client side, you need to request the new Captcha instance based on the new (locale-specific) Captcha style from your back-end, and load that newly generated Captcha image on a client side.

Here is the example of botdetect.xml configuration file with locale-specific styles:

<?xml version="1.0" encoding="UTF-8"?> 
<botdetect> 

  <captchaStyles> 
    <captchaStyle> 
      <name>loginCaptcha_en</name> 
      <userInputID>yourFirstCaptchaUserInput</userInputID> 
      <locale>en</locale> 
    </captchaStyle> 

    <captchaStyle> 
       <name>loginCaptcha_ja</name> 
       <userInputID>yourFirstCaptchaUserInput</userInputID> 
       <locale>ja</locale> 
    </captchaStyle> 

    <captchaStyle> 
       <name>loginCaptcha_ko</name> 
       <userInputID>yourFirstCaptchaUserInput</userInputID> 
       <locale>ko</locale> 
    </captchaStyle> 

    <captchaStyle> 
       <name>loginCaptcha_zh_TW</name> 
       <userInputID>yourFirstCaptchaUserInput</userInputID> 
       <locale>zh-cmn-Hant-TW</locale> 
    </captchaStyle> 
  </captchaStyles> 

</botdetect> 

Examples of usage in various JavaScript frontends:

1. jQuery

<script type="text/javascript"> 
    var captchaLocaleStyleName = 'loginCaptcha_en'; 
    var captchaDirectiveElement = 
      '<div id="botdetect-captcha" data-captchastylename="' 
      + captchaLocaleStyleName + '"></div>'; 
    document.write(captchaDirectiveElement); 
</script> 
<input id="yourFirstCaptchaUserInput" type="text"/> 

2. Angular

const captchaLocaleStyleName = 'loginCaptcha_en'; 
<botdetect-captcha captchaStyleName={{captchaLocaleStyleName}}></botdetect-captcha> 
<input id="yourFirstCaptchaUserInput" 
       name="yourFirstCaptchaUserInput" 
       ngModel 
       #yourFirstCaptchaUserInput="ngModel"  
       type="text" > 

3. AngularJS

$scope.captchaLocaleStyleName = 'loginCaptcha_en'; 
<botdetect-captcha captchaStyleName={{captchaLocaleStyleName}}></botdetect-captcha> 
<input id="yourFirstCaptchaUserInput" 
    type="text" 
    name="yourFirstCaptchaUserInput" 
    ng-model="yourFirstCaptchaUserInput" > 

4. React

const captchaLocaleStyleName = 'loginCaptcha_en'; 
<Captcha 
    captchaStyleName={captchaLocaleStyleName} 
    ref={(captcha) => {this.captcha = captcha}} 
/> 
<input id="yourFirstCaptchaUserInput" type="text" /> 

Please Note

This document is not up to date. Ignore it until the furher notice. We are working on fixing it. Your Simple API integration efforts should start with one of the following four step-by-step integration guides: Angular Captcha, AngularJS Captcha, jQuery Captcha, React Captcha.