If an HTML form has two buttons, how do I know which got clicked?

Yes, you can rely on this; it’s fully documented here. The specific relevant lines say:

When a form is submitted for processing, some controls have their name paired with their current value and these pairs are submitted with the form. Those controls for which name/value pairs are submitted are called successful controls.

and

If a form contains more than one submit button, only the activated submit button is successful.

Leave a Comment