<div dir="ltr"><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Richard Reina</b> <span dir="ltr"><<a href="mailto:gatorreina@gmail.com">gatorreina@gmail.com</a>></span><br>Date: 2015-10-02 8:36 GMT-05:00<br>Subject: Re: [dancer-users] Template Toolkit Help<br>To: Perl Dancer users mailing list <<a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a>><br><br><br><div dir="ltr"><span class=""><br><div class="gmail_extra"><br><div class="gmail_quote">2015-10-01 17:33 GMT-05:00 Andrew Beverley <span dir="ltr"><<a href="mailto:andy@andybev.com" target="_blank">andy@andybev.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>On Thu, 2015-10-01 at 16:10 -0500, Richard Reina wrote:<br>
> Both forms have submit buttons but I am not sure how to make the POST<br>
> route understand that the user is done with the form so that I can in<br>
> turn make it save the data.<br>
<br>
</span>You can differentiate between submit buttons by checking for the name of<br>
the submitted button, just like any other control on the form.<br>
<br>
If I've understood correctly, then I'd just have the one form, and use<br>
different submit button names.<br>
<div><div><br>
Andy<br></div></div></blockquote></div><br></div><div class="gmail_extra">Sent before I was finished. Gmail needs to take the send button out of the tab index!!!<br></div><div class="gmail_extra"><br></div></span><div class="gmail_extra">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?<br><br>post '/entries_form' => sub { <br><br>    if (defined param('add_entries')) { # the source of this submission was the add_entries button<br>        <br></div><div class="gmail_extra">         # qualify and summarize addition<br></div><div class="gmail_extra">          redirect '/entries_form';<br></div><div class="gmail_extra">  <br></div><div class="gmail_extra">   } elsif (defined param('submit_entries')) { </div><div class="gmail_extra"><br></div><div class="gmail_extra">     # update submission to make them final<br></div><div class="gmail_extra">}<br></div><div class="gmail_extra"><br></div></div>
</div><br></div>