[dancer-users] Fwd: Template Toolkit Help

Richard Reina gatorreina at gmail.com
Fri Oct 2 14:40:42 BST 2015


---------- Forwarded message ----------
From: Richard Reina <gatorreina at gmail.com>
Date: 2015-10-02 8:36 GMT-05:00
Subject: Re: [dancer-users] Template Toolkit Help
To: Perl Dancer users mailing list <dancer-users at dancer.pm>




2015-10-01 17:33 GMT-05:00 Andrew Beverley <andy at andybev.com>:

> On Thu, 2015-10-01 at 16:10 -0500, Richard Reina wrote:
> > Both forms have submit buttons but I am not sure how to make the POST
> > route understand that the user is done with the form so that I can in
> > turn make it save the data.
>
> You can differentiate between submit buttons by checking for the name of
> the submitted button, just like any other control on the form.
>
> If I've understood correctly, then I'd just have the one form, and use
> different submit button names.
>
> Andy
>

Sent before I was finished. Gmail needs to take the send button out of the
tab index!!!

So provided that I have named one button with name="add_entries" and the
second name="submit_entries" could i just do the following in my dancer app?

post '/entries_form' => sub {

    if (defined param('add_entries')) { # the source of this submission was
the add_entries button

         # qualify and summarize addition
          redirect '/entries_form';

   } elsif (defined param('submit_entries')) {

     # update submission to make them final
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20151002/e61aef9c/attachment.html>


More information about the dancer-users mailing list