Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

Forms with multiple buttons?

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


wxju46gefd at snkmail

Apr 12, 2011, 5:50 AM

Post #1 of 2 (339 views)
Permalink
Forms with multiple buttons?

I've chosen Catalyst::Controller::HTML::FormFu to use with my app.

How would I have a form with multiple buttons? For example "revert", "preview", and
"commit"? The latter two want the same textarea to be sent, so are part of the same form.

Even having a different Form for "revert", since it doesn't use the same data and does a
totally different action, I have no idea how to accomplish based on the documentation
examples. Even if I didn't rely on the {form} stash variable but made more than one
variable directly, how does it know which form was triggered? The basic concept of the
module is that forms are rendered and processed at the same URL. That bothered me at
first, but I can see how it is very good for successive attempts to submit a form with errors.

--John


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


garrison at zeta

Apr 12, 2011, 2:48 PM

Post #2 of 2 (319 views)
Permalink
Re: Forms with multiple buttons? [In reply to]

Good morning,

On 12/04/11 at 7:50 AM -0500, John M. Dlugosz
<wxju46gefd [at] snkmail> wrote:

>I've chosen Catalyst::Controller::HTML::FormFu to use with my app.

I'd suggest asking this on the HTML::FormFu list.

>How would I have a form with multiple buttons? For example "revert",
>"preview", and "commit"? The latter two want the same textarea to be
>sent, so are part of the same form.

Unless I'm missing something in your requirements, you would
just use multiple Submit elements in your form config. As long
as each has a different name then you can check req->params to
know which button was used to submit the form.


Charlie

--
Ꮚ Charlie Garrison ♊ <garrison [at] zeta>

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt


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

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.