Hi There
I am using Catalyst::Controller::FormBuilder to create my forms. Its working
great for me except for this one issue:
I would like to specify a field that has a regexp that has a comma in it.
For example:


sub doStuff : Path('/doStuff) Form('/doStuff') {

.....
}

My doStuff.fb file has the following field

fields:
   username:
       label: Username
       size: 40
       validate: /^[^,"]{6,40}$/

ie I want the username field to contain 6-40 characters without any single
or double quotes.
Unfortunately the validation code for this on the javascript side turns
into:

   var username = form.elements['username'].value;
   if (username == null || (username != '/^[^'"]{6' && username != '40}+$/')) {
       alertstr += 'Username should be between 6 and 40 characters
and should not contain single-quotes (\') or double-quotes (")\n';
       invalid++;
   }


ie. The value is split at the , sign.
This looks like it would be a fairly common problem. Any workaround for
this?
Thanks
Balaji
_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to