Skip to content

cor3000/zk-recaptcha

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>

About

a ZK reCaptcha integration

Resources

Stars

Watchers

Forks

Packages

No packages published