[html-formfu] Populating options for Select elements

Carl Franks fireartist at gmail.com
Mon Jun 1 12:36:24 GMT 2009


2009/6/1 Nigel Metheringham <nigel.metheringham at dev.intechnology.co.uk>:
> I have a Catalyst/DBIx::Class app I am attempting to convert to HTML::FormFu
> (using latest currently available HTML::FormFu modules from CPAN).
>
> Within a form I have a Select element.
> It appears the possibilities for the options of the select element are that
> I can either specify a set of possible options in the form config file, or
> use a resultset from the DBIC model.
>
> What I need is a object specific set of options - in my case its a set of
> dates within a range defined in the parent object.
>
> So ideally I need a way to use a stash value as the list of options, or
> maybe a model method to retrieve the list of possible option values.
>
> Is there a way I can do this?

I achieve this by creating a custom plugin which inherits from
HTML::FormFu::Plugin and defines a 'pre_process' method that does the
heavy-work.

Cheers,
Carl



More information about the HTML-FormFu mailing list