9 Feb 2007 23:56
[FormBuilder] validate + commas in FB source files
kevin montuori <montuori <at> gmail.com>
2007-02-09 22:56:22 GMT
2007-02-09 22:56:22 GMT
hi all -- first off, CGI::FB is a great module. it's saved me
countless hours of tedious mind-numbing typing. thanks a lot to
nate and anyone else responsible.
i have a question about using CGI::FormBuilder::Source::File with
regexps in the validate field: one of the things i really want to do
is make sure the length of the input is between a min and max value:
validate: /^\w{3,32}$/
and it seems like this sort of thing would be not atypical.
unfortunately, the regex is split into two values when there's a comma
in the regex (via $source->write_module()):
'validate' => [
'/^\\w{3',
'32}$/'
so : is there a canonical way of checking for min/max length that i'm
not aware of?
would there be any interest in changing File.pm (~ line 155) from:
# split commas
<at> val = split /\s*,\s*/, $line;
to something like:
# split commas
(Continue reading)
)
Please do. Provide a diff -u and also a couple tests, and I'll apply
it to the tree.
Thanks,
Nate
_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
RSS Feed