[html-formfu] RFC: enhanced when

Carl Franks fireartist at gmail.com
Fri Oct 26 15:14:57 GMT 2007

On 24/10/2007, Jonas Alves <jonas.alves at gmail.com> wrote:
> I would like to enhance the "when" attribute to accept something like this:

>              − type: Equal
>                others: password
>                when:
>                  field: password

This looks reasonable.

> So when the "when" attribute receives a "field" attribute without a "values"
> attribute it returns true if the field is filled. Another enhance is to
> receive a "stash" attribute that works like the "field" attribute but checks
> the stash instead. However it makes it impossible to use both "field" and
> "stash" attributes at the same time because the "values" attribute can't
> work for both at the same time. To handle that we can make "field" and
> "stash" accept an hash ref. The config would look like:

I'm worried that tying validation in with the stash is a bit messy.
The stash is supposed to be temporary user-space, that FormFu doesn't touch.
Granted, we do store the catalyst context in the stash, so that we can
retrieve DBIC models.
What sort of use-cases do you have in mind for this?

> Another thing that I miss is a way to specify how I want the values to be
> compared. Sometimes I don't want to use "eq" and a regex would be more
> appropriated:

Sounds good.


More information about the HTML-FormFu mailing list