I have a PHP-generated page which is displaying some data about a set of films. The page is updated using POST. The form only shows films starting with a particular letter. I want to present a set of clickable options at the top of the screen, each of which is a letter. So if you click on ‘B’ it submits the form and re-draws the page showing only films that start with B. (I know, Ajax would be a better way to do this, but I’m trying to get something done quickly).
Anyway, I know I can do this by having each link be a Javascript call which sets the value of a hidden field and then submits the form, or I could do it by having each letter be a button which has a particular value and submits the form directly, but neither of those strikes me as particularly elegant. Is there a standard way to do this? Am I missing something really obvious?
You can always create a number of submit buttons and give each a different name. Then you test to see which submit was pressed based on what is included in the POST array.
Please note that you can use the image input type in place of the submit input type so that you can substitute your own image, etc for your button.