2 Oct
2015
2 Oct
'15
3:28 p.m.
On Fri, 2015-10-02 at 08:40 -0500, Richard Reina wrote:
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 }
Yes, exactly that. As an aside, you can lose "defined" (might make the code a little more readable), as long as you have a value for the submit button. Andy