fixed form processing of yes/no fields

This commit is contained in:
JT Smith 2007-08-01 18:23:59 +00:00
parent fe734f2359
commit 9bcc48f123

View file

@ -109,16 +109,9 @@ An optional value to process, instead of POST input. This should be in the form
sub getValueFromPost {
my $self = shift;
my $formValue;
if (@_) {
my $value = shift;
return '' unless length $value; # empty import value?
return ($value =~ /^y/i || $value eq '1') ? 1 : 0;
}
else {
return $self->SUPER::getValueFromPost;
}
my $value = shift;
$value = $self->SUPER::getValueFromPost unless (defined $value);
return ($value =~ /^y/i || $value eq '1') ? 1 : 0;
}
#-------------------------------------------------------------------