back to project page

ChenilleKit Demo V1.0.2

code snippet
<form t:id="kaptchaForm">
	<t:errors/>
	<div t:id="kaptchaComponent"/>
	<br/>
	<input type="submit"/>
</form>

page class

@Persist
@Property
private boolean inputValue;

@Component
private Form kaptchaForm;

@Component(parameters = {"value=inputValue"})
private Kaptcha kaptchaComponent;

public boolean onValidateForm()
{
	boolean goodValidation = true;

	if (!inputValue)
	{
		kaptchaForm.recordError("kaptcha value not equals the user input!");
		goodValidation = false;
	}

	return goodValidation;
}

Footer