[html-formfu] Dumb(?) questions on HTML::FormFu::Model::DBIC

Carl Franks fireartist at gmail.com
Thu Mar 6 11:40:15 GMT 2008


On 06/03/2008, Alex Povolotsky <tarkhil at over.ru> wrote:
> Zbigniew Lukasiak wrote:
>  > When you put schema on the form stash it is used as the model:
>  >
>  > $form->stash->{schema} = $c->model( 'DBSchema' );
>  >
>  > This is from my app.
>  >
>
> Thanks; looks like I've got some trouble with my model, but I've got the
>  idea.
>
> >
>  >>  2. Can I somehow make simple validation of password (usual two fields,
>  >>  matching each other) using HTML::FormFu?
>  >>
>  >
>  > See HTML::FormFu::Constraint::Equal
>  >
>
>
> Looked at it. Understood nothing. Can't you please supply me with more
>  complete example?

The docs describe the exact solution you requested.

SYNOPSIS

    type: Equal
    name: password
    others: repeat_password

DESCRIPTION

All fields named in "others" must have an equal value to the field
this constraint is attached to.


To spell it out...

    elements:
      - type: Password
        name: password
        constraints:
          - type: Equal
            others: repeat_password
      - type: Password
        name: repeat_password

Carl



More information about the HTML-FormFu mailing list