in template file:
<form t:id="addToShoppingCartForm" t:type="form">
<t:label for="productAmount"/><input t:id="productAmount"
t:validate="required,regexp,min=1" t:type="textField" size="3"
style="ime-mode:disabled;"/>
<t:textField t:id="itemId" style="display:none;"/>
<input type="submit" value="${message:add.to.shopping.cart}"/>
</form>
in properties file:
productAmount-regexp=^[1-9]
The product amount can't start with zero.
> From: [email protected]
> To: [email protected]
> Subject: Tapestry Regexp Validator
> Date: Fri, 18 May 2012 15:58:12 +0800
>
>
> Tapestry 5.3.2:
> I try to use Email validator in my email input field, but it doesn't work.
> Then I use the regexp validator in my properties file like this:
> email-regexp=^[a-zA-Z0-9_\-]+@[a-zA-Z0-9_\-]+(\.[a-zA-Z0-9_\-]+)+$
> It still doesn't work.
> Finally I found even regexp like this "^[1-9]" doesn't work.
> If I change the "^[1-9]" to "/^[1-9]/", it works, but still doesn't work with
> email-regexp.