On Sun, May 13, 2007 at 10:43:31AM -0700, Balaji Srinivasan wrote:
> Rather than the two approaches above, I think a better one was to add a new
> validation type to the FormBuilder VALIDATE array.
> $CGI::FormBuilder::Field::VALIDATE{FOOFIELD} = '/^[^,"]{6,40}$/';
> 
> Now in all my forms, i just set the validate field to FOOFIELD.
> This works great for me. It avoide me having to write my own validation code
> and also avoids the need to add the regex to each form.

If this is a personal project and you'll always be the only developer, fine.

If this is commercial work I consider it a terrible idea, but I hold my
commercial work to high standards.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/             http://www.shadowcatsystems.co.uk/ 

_______________________________________________
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