diff --git a/html/determine-which-button-submitted-the-form.md b/html/determine-which-button-submitted-the-form.md new file mode 100644 index 0000000..ce12f73 --- /dev/null +++ b/html/determine-which-button-submitted-the-form.md @@ -0,0 +1,25 @@ +# Determine Which Button Submitted The Form + +It is pretty common for a form to have a singular submit button. If the user clicks 'Submit', then the form fires a `POST` off to the server, the server can process the request, and that's it. + +But what about a form that has two or more buttons? For instance, imagine some kind of consent form where the user needs to either _Accept_ or _Reject_ some terms. + +Just like other inputs, [the ` + + + +``` + +In addition to the `email` attribute, when the user submits the form, it will include a `commit` attribute that has a value of either `'accept'` or `'reject'`. + +