I have two submit buttons in a form. How do I determine which one was hit serverside?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
I think you should be able to read the name/value in your GET array. I think that the button that wasn't clicked wont appear in that list.
This is extremely easy to test
Just put that in an HTML page, click the buttons, and look at the URL
The best way to deal with multiple submit button is using switch case in server script
server code/server script - where you are submitting the form:
demo_form.php
Source: W3Schools.com
Simple you can change the action of form on different submit buttons Click.
Try this in document.Ready
You can also use a href attribute and send a get with the value appended for each button. But the form wouldn't be required then