I'm setting up a form wherein I need two "actions" (two buttons):
1 - "Submit this form for approval"
2 - "Save this application for later"
How do I create an HTML form that supports multiple "actions"?
EG:
<form class="form-horizontal" action="submit_for_approval.php">
<form class="form-horizontal" action="save_for_later.php">
I need to combine these two options-for-submitting into one form.
I did some basic research but couldn't find a definitive answer as to whether or not this is possible, and/or any good resources to links for a workaround.
Thanks in advance.
the best way (for me) to make it it's the next infrastructure:
with this structure you will send with enter a direction and the infinite possibilities for the rest of buttons.
As @AliK mentioned, this can be done easily by looking at the value of the submit buttons.
When you submit a form, unset variables will evaluate false. If you set both submit buttons to be part of the same form, you can just check and see which button has been set.
HTML:
PHP
EDIT
If you'd rather not change your PHP setup, try this: http://pastebin.com/j0GUF7MV
This is the JavaScript method @AliK was reffering to.
Related: