htmlformssubmit

Two submit buttons in one form


I have two submit buttons in a form. How do I determine which one was hit serverside?


Solution

  • If you give each one a name, the clicked one will be sent through as any other input.

    <input
        type="submit"
        name="button_1" 
        value="Click me"
    >