s2cuts has asked for the wisdom of the Perl Monks concerning the following question:

Good Day Monks,

I'm trying to read the value of a form element from within a Catalyst controller. This is being performed after the form has been submitted and validated.

This seems to work to locate the desired element.

my $this_element = $form->get_all_element({name => 'element_name'});
But the following doesn't work to get the value of the element out.
my $element_value = $this_element->value;
Any help would be greatly appreciated.

Replies are listed 'Best First'.
Re: HTML::FormFu, reading value of an element from controller...
by Anonymous Monk on Jul 14, 2012 at 08:46 UTC
      Hmmmm, I've read through that post. And although it is in regard to removing elements, not simply reading the value of an element, I tried a few variations on what I saw there without success.

      I also started looking at the documentation referenced in that post, but I just started running around in circles.

      If anyone can take a look at the code samples I put up in my original post, all I need to know is what the method is that looks into an element object and retrieves the value of the field. Or if you could please provide a link to the doc that describes such a method or technique.

      Thanks

Re: HTML::FormFu, reading value of an element from controller...
by Anonymous Monk on Jul 16, 2012 at 21:26 UTC
    $form->param_value('element_name')

      Yup, it appears the form data is part of the form only, not the elements, the elements are just placeholder, so  $form->param_value( $pariah->name );

      Seems like the kind of thing that would be explained somewhere in the manual -- I don't use formfu at all