got5/tapestry5-jquery — Issue #99: Regexp Javascript Validation
Author: trsvax
Created: 2011-11-21 16:37:11+00:00
State: open

There appears to be a problem with client side regexp validation. If I use the regexp property file from the bean edit demo

zip-regexp=^\\d{5}(-\\d{4})?$
zip-regexp-message=Zip Codes are five or nine digits. Example: 02134 or 90125-1655.

I get a JSON parse error when the page loads. The Javascript generated is

[
"regexp",
"Zip Codes are five or nine digits. Example: 02134 or 90125-1655.",
"^\\d{5}(-\\d{4})?$"
]

The error is from around line 561 of jquery-1.6.2.js

if ( window.JSON && window.JSON.parse ) {
return window.JSON.parse( data );
}