-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
52 lines (37 loc) · 1020 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
a ZK component for reCaptcha integration.
---
* HOW TO USE
1.Create recaptcha key , fill domain name in the following link to get the keys.
https://www.google.com/recaptcha/admin/create
2.get the private key / public key
3.set it in zk.xml
<!-- my public test key -->
<library-property>
<name>org.zkoss.recaptch.publickey</name>
<value>my public key</value>
</library-property>
<library-property>
<name>org.zkoss.recaptch.privatekey</name>
<value>my private key</value>
</library-property>
4.Restrictions
a.The AJAX API only allows you to show one reCAPTCHA widget at a time.
b.You could only verify the answer with google service once per challenge.
5.Sample Zul
<zk>
<vlayout>
<div>
<label value="name" /> <textbox id="test" />
</div>
<recaptcha id="captcha" />
<button label="check" >
<attribute name="onClick">
if(captcha.isValid()){
alert(test.getValue());
}else{
alert("captcha failed");
}
</attribute>
</button>
</vlayout>
</zk>