I have a php driven website and html form which contains multiple submit buttons and each submit button is been accompanied with a hidden input field containing data for that specific submit button. Earlier I had each submit button + hidden input field inside separate forms but in order to reduce the page loading time, I'm trying to have only one form covering all the submit buttons and hidden input fields.
Now the question is:
How can I detect which submit button was being pressed and which hidden field should be sent?
- Include the needed data from the hidden field into the submit button id value (each hidden data is unique containing date time info etc.). But this needs a method to access the id value later on and apparently php can only retrieve the value, am I right?
- Hmm.. maybe what if I change the submit button name into the unique hidden data. Then I'd have to have a while loop to go through all the possible choices...
Apparently I need some new ideas here.
The included image illustrates a bit more the situation.