From ad5b117f7a5fbc1c31fec0fbb7bbce278bffdd82 Mon Sep 17 00:00:00 2001 From: byt3h3ad Date: Sat, 11 May 2024 04:25:39 +0530 Subject: [PATCH] yoloing at 2024-05-11T04.25 --- ...termine-which-button-submitted-the-form.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 html/determine-which-button-submitted-the-form.md 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'`. + +