Re: [dfv] field filters not executed for optional?
Status: Inactive
Brought to you by:
markjugg
|
From: Mark S. <ma...@su...> - 2010-12-14 21:29:29
|
On 12/14/2010 08:29 AM, Jiří Pavlovský wrote:
> Hi,
>
> what I want to achieve is to filter checkbox values so that they are
> either 1 or 0, ie no undef values.
>
> So I put them into optional and set up field_filters for them with an
> sub like this
>
> sub checkbox_filter {
> return defined $_[0] && lc $_[0] eq 'on' ? 1 : 0;
> }
>
> But it looks like the filed filters are never executed.
They should be working. Could you supply a Test::More test case that
shows they are not? Test::FormValidator may be useful.
You could also post a version of your profile for us to review.
Mark
|