Your regular expression indicates that productionAmount should be 1-9. Is that 
so ?

if it is a number not starting with zero shouldn't it be ^[1-9][0-9]* or 
^[1-9]\\d*

On May 18, 2012, at 1:55 PM, Fight Ice wrote:

> 
> 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: ricr...@hotmail.com
>> To: users@tapestry.apache.org
>> 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.                                    
>                                         


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to