FAQ
Hello all,

I am trying to set up a form using a .TT2, but no .fb, using
"formbuilder.start" etc. I can assign a value to an input, and it shows on
the page, but after submit, the value shows in "[debug] Body Parameters",
but when I try to retrieve the value with $form->field, I get "" back. This
seems like it should be simple enough, where have I gone astray??

TIA,
Chris

Search Discussions

  • Mitch Jackson at Jun 9, 2008 at 6:44 pm
    Chris,

    Sounds like you're looking for:
    $c->request->params->{field}

    /Mitch
    On Mon, Jun 9, 2008 at 12:21 PM, Chris Devine wrote:

    Hello all,

    I am trying to set up a form using a .TT2, but no .fb, using
    "formbuilder.start" etc. I can assign a value to an input, and it shows on
    the page, but after submit, the value shows in "[debug] Body Parameters",
    but when I try to retrieve the value with $form->field, I get "" back. This
    seems like it should be simple enough, where have I gone astray??

    TIA,
    Chris



    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/
  • Chris Devine at Jun 9, 2008 at 6:54 pm
    Works great! Thanks for the help.

    Chris

    -----Original Message-----
    From: Mitch Jackson
    Sent: Monday, June 09, 2008 12:44 PM
    To: The elegant MVC web framework
    Subject: Re: [Catalyst] Another newbie question...

    Chris,

    Sounds like you're looking for:
    $c->request->params->{field}

    /Mitch
    On Mon, Jun 9, 2008 at 12:21 PM, Chris Devine wrote:

    Hello all,

    I am trying to set up a form using a .TT2, but no .fb, using
    "formbuilder.start" etc. I can assign a value to an input, and it
    shows on the page, but after submit, the value shows in "[debug] Body
    Parameters", but when I try to retrieve the value with $form->field, I
    get "" back. This seems like it should be simple enough, where have I gone astray??
    TIA,
    Chris



    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/
    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/
  • Bill Moseley at Jun 9, 2008 at 10:21 pm

    On Mon, Jun 09, 2008 at 12:44:07PM -0500, Mitch Jackson wrote:
    On Mon, Jun 9, 2008 at 12:21 PM, Chris Devine wrote:

    I am trying to set up a form using a .TT2, but no .fb, using
    "formbuilder.start" etc. I can assign a value to an input, and it shows on
    the page, but after submit, the value shows in "[debug] Body Parameters",
    but when I try to retrieve the value with $form->field, I get "" back. This
    seems like it should be simple enough, where have I gone astray??
    Sounds like you're looking for:
    $c->request->params->{field}
    This is using FormBuilder?


    I have not used FormBuilder in a while but wouldn't you want something
    like:

    $form->field->{foo};
    or
    $form->field('foo');

    $c->req->parameters->{foo} is the raw posted data. I would assume it
    could be different if the form validation process modified the input
    data.

    For example, in Form::Processor, a date input might be one or more
    elements of $c->req->parameters, but you would access it as

    $form->field('some_date')->value;

    ( or shorthand $form->value( 'some_date' ) )

    and that would return a DateTime object.



    --
    Bill Moseley
    moseley@hank.org
    Sent from my iMutt
  • Chris Devine at Jun 10, 2008 at 1:47 pm
    -----Original Message-----
    From: Bill Moseley
    Sent: Monday, June 09, 2008 4:22 PM
    To: The elegant MVC web framework
    Subject: Re: [Catalyst] Another newbie question...
    On Mon, Jun 09, 2008 at 12:44:07PM -0500, Mitch Jackson wrote:
    On Mon, Jun 9, 2008 at 12:21 PM, Chris Devine wrote:

    I am trying to set up a form using a .TT2, but no .fb, using
    "formbuilder.start" etc. I can assign a value to an input, and it
    shows on the page, but after submit, the value shows in "[debug]
    Body Parameters", but when I try to retrieve the value with
    $form->field, I get "" back. This seems like it should be simple enough,
    where have I gone astray??
    Sounds like you're looking for:
    $c->request->params->{field}
    This is using FormBuilder?


    I have not used FormBuilder in a while but wouldn't you want something
    like:

    $form->field->{foo};
    or
    $form->field('foo');

    $c->req->parameters->{foo} is the raw posted data. I would assume it could
    be different if the form validation process modified the input data.

    For example, in Form::Processor, a date input might be one or more elements
    of $c->req->parameters, but you would access it as

    $form->field('some_date')->value;

    ( or shorthand $form->value( 'some_date' ) )

    and that would return a DateTime object.



    --
    Bill Moseley
    moseley@hank.org
    Sent from my iMutt

    ======================================

    Yes, using FormBuilder.

    I originally was using $form->field('foo'). I just tried
    $form->field->{foo}. They both return "".

    I'm not sure why it's not working as it should.

    Thanks,
    Chris

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedJun 9, '08 at 6:21p
activeJun 10, '08 at 1:47p
posts5
users3
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase