Thanks, Dave. the part that I'd missed int he docs was about how to tell if any params had been submitted. I had done some coding around that problem before implementing formhandler. Nice that I can leverage that.

Thanks again for pointing that out.

Eric

On 3/4/11 8:57 AM, David Schmidt wrote:

On Fri, Mar 4, 2011 at 2:23 PM, Eric Berg<[email protected]>  wrote:
I'm trying to do some progressive engagement by allowing one of my forms to
be filled out before a user is required to log in, but once the form is
filled, I need them to log in so that I can get the user ID, which is part
of the record for that form's row in my db.

I'm using  HTML::FormHandler::Model::DBIC and generally sticking to the
example here:
http://search.cpan.org/~gshank/HTML-FormHandler-0.32005/lib/HTML/FormHandler/Manual/Catalyst.pod#A_Controller_Example

The problem is that I don't know how to check to see if the form has been
submitted and validated so that I know when to forward to /login.

It feels to me like the approach laid out at the URL above is a bit simple
for this approach, but so far I haven't figured out how to do anything more
low-level.  Seems like setting the form as an attribute of the controller
and then doing the processing and validating in my methods/actions might be
the way to go.

Anyone have any examples or advice?

Thanks.

Eric

_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/


Been a while since I last used HFH but how about

$form->validated;

that should only return true if the form was validated and from
skimming through the docs validation is only done if form parameters
are present.

david


_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to