Nar*_*pai 0 jquery tapestry currency-formatting
我有一个页面需要简单验证绑定到我的页面类中的双变量的文本字段.这是通过jquery-formatcurrency实现的,它也设置值("0.0"到"$ 0.00").
<t:textfield t:id="bills" value="projection.current"/>
Run Code Online (Sandbox Code Playgroud)
然而,现在当该字段触发模糊事件或页面提交时,tapestry说:
You must provide a numeric value for bills
Run Code Online (Sandbox Code Playgroud)
(显然是由于"$")
所以我的想法是禁用这一页的验证,因为jquery-formatcurrency可以处理验证.然后我可以覆盖翻译器,因为它在tapestry文档中声明了覆盖Translator with Events以处理表单字段.
提前致谢.
小智 5
<t:form t:clientValidation="none">
Run Code Online (Sandbox Code Playgroud)
...将禁用表单上的客户端验证.
你也可以做clientValidation ="submit",它在提交而不是onBlur上验证,你可以试试吗?
更多信息:
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Form.html http://tapestry.apache.org/5.3.7/apidocs/org/apache/tapestry5/corelib /ClientValidation.html