Skip to main content

Configuration

Zencaptcha Widget Configuration

You can configure Zencaptcha to set custom optional attributes on the Zencaptcha container.

Optional attribute examples
<div class="zenc-captcha"  data-sitekey="<sitekey>" data-callback="<function name>" data-start="<auto|focus>" data-lang="<lang>"></div>
AttributeValueDescription
data-sitekey<sitekey>Your public site key.
data-callback<function name>Optional. Called when the challenge is successfully solved. The solution (token) will be passed to your callback.
data-lang<two letter language code>Optional. The widget will automatically select the best language for the user (30+ languages). However, you can override this and set the widget to a fixed single language. The full list of two-letter language codes is below.
data-startauto/focusOptional.
auto: This will start solving the challenge immediately after the page load.
focus: This will start solving the challenge immediately when the user clicks into an input within the <form>. The zenc-captcha div needs to be inside that <form> for focus to work. See example below.
Two letter language codes

One of these two letter language codes can be inserted into the data-lang attribute.

CodeLanguage
bgBulgarian
caCatalan
csCzech
daDanish
deGerman
elGreek
enEnglish
etEstonian
esSpanish
fiFinnish
frFrench
hrCroatian
huHungarian
itItalian
jaJapanese
ltLithuanian
lvLatvian
nlDutch
noNorwegian
plPolish
ptPortuguese
roRomanian
ruRussian
skSlovak
slSlovenian
srSerbian
svSwedish
ukUkrainian
viVietnamese
zhChinese
start with user input

The following code immediately resolves the captcha as soon as the user clicks in an input field inside <form> or inside <div class="zenc-form">. zenc-captcha must be inside it. The user does not have to actively click on the Zencaptcha widget, resulting in a great user experience

data-start=focus -> within <form>
<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name" placeholder="Enter your name">
<div class="zenc-captcha" data-start="focus" data-sitekey="<sitekey>"></div>
</form>
data-start=focus -> within <div class='zenc-form'>
<div class="zenc-form">
<label for="name">Name:</label>
<input type="text" id="name" name="name">
<div class="zenc-captcha" data-start="focus" data-sitekey="<sitekey>"></div>
</div>