source: extensions/EasyCaptcha/template/contactform.tpl @ 26069

Revision 26069, 1.2 KB checked in by mistic100, 6 years ago (diff)

try to simplify integration of captchas

Line 
1<tr>
2  {include file=$EASYCAPTCHA_ABS_PATH|cat:'template/common.inc.tpl'}
3
4  {* <!-- DRAG & DROP --> *}
5  {if $EASYCAPTCHA.challenge == 'drag'}
6  <td class="title"></td>
7  <td>
8    {'To verify you are a human, please place the <b>%s</b> in the most right box bellow.'|translate:$EASYCAPTCHA.drag.text}
9    {$smarty.capture.easycaptcha}
10  </td>
11
12  {footer_script}
13  var captcha_code = new LiveValidation(jQuery('input[name="easycaptcha"]')[0], {ldelim} onlyOnSubmit: true });
14  captcha_code.add(Validate.Presence, {ldelim} failureMessage: "{'Pleaser answer'|translate}" });
15  {/footer_script}
16
17  {* <!-- TIC TAC TOE --> *}
18  {else if $EASYCAPTCHA.challenge == 'tictac'}
19  <td class="title"></td>
20  <td>
21    {'You are player X, click on the right case to complete the line.'|translate}
22    {$smarty.capture.easycaptcha}
23  </td>
24
25  {footer_script}
26  var captcha_code = new LiveValidation(jQuery('input[name="easycaptcha_key"]')[0], {ldelim} onlyOnSubmit: true });
27  captcha_code.add(Validate.Custom, {ldelim}
28    failureMessage: "{'Pleaser answer'|translate}",
29    against: function() {ldelim}
30        return jQuery('input[name="easycaptcha"]:checked').length != 0;
31    }
32  });
33  {/footer_script}
34
35  {/if}
36</tr>
Note: See TracBrowser for help on using the repository browser.