Form with multiple actions
Author | Message |
---|---|
Pepsida | # Posted yesterday |
Hi all, I'm setting up a form wherein I need to have at least two different "actions", with two different submit buttons. For example, I need both:
Here is what I want to do. <form method="post" action="submit.php" action="save.php">I need to "link" each action to one of the submit button and I don't know how to proceed. Any tips on how I can do it ? Thanks in advance ! |
|
Ads | |
Rel0ad | # Posted two hours ago |
You don't need two forms to do that. If one of the buttons is clicked it will show up in backend, that's how you differentiate the two and redirect accordingly. |
|
Posey | # Posted one hour ago |
This can be done by changing the values of the submit buttons, but you will need a server side language to In PHP: if($_POST['send']) { ... }You can read more about how to handle forms here : http://www.siteraw.com/html-css/how-to-create-a-website/forms. |
|
Demonecromancy | # Posted 37 minutes ago |
You can also fiddle with JS if you want to send the post data to another page entirely, not just redirect the user there. If you don't need to, stick with the above answers and a back-end language. |
|
Jaguar | # Posted 5 minutes ago |
If you want a complete code.<?php |