[Catalyst] Empty strings and FormValidator

Michael Reece mreece at sacbee.com
Tue Apr 19 19:03:52 CEST 2005


Nevermind, I found the 'missing_optional_valid => 1' option.

On 4/19/05 9:55 AM, "Michael Reece" <mreece at sacbee.com> wrote:

> Using Catalyst::Plugin::FormValidator and Class::DBI::FromForm, I noticed
> that 'cleared' values (empty string) are not saved.
> 
> This is because Data::FormValidator->check deletes empty values from the
> 'valid' hash:
> 
> (in Data/FormValidator/Results.pm, sub _process)
> 
>   delete $valid{$field} unless (defined $valid{$field} and length
> $valid{$field});
> 
> so these cleared fields are never updated by update_from_form.
> 
> Has anyone dealt with this problem or have suggestions?
> 
> 
> 
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
> 

-- 
michael reece :: web engineer :: mreece at sacbee.com :: (916)321-1249





More information about the Catalyst mailing list