Let form document be the form's Document
.
If form document has no associated browsing context or its active sandboxing flag set has its sandboxed forms browsing
context flag set, then abort these steps without doing anything.
Let form browsing context be the browsing context of form document.
If the submitted from submit()
method flag is not set, and the submitter element's no-validate state is false, then
interactively validate the constraints of form and examine the
result: if the result is negative (the constraint validation concluded
that there were invalid fields and probably informed the user of this)
then fire a simple event named invalid
at the form element
and then abort these steps.
If the submitted from submit()
method flag is not set, then fire a simple event that bubbles and is cancelable named
submit
, at form. If the event's default action is prevented (i.e.
if the event is canceled) then abort these steps. Otherwise, continue
(effectively the default action is to perform the submission).
Let form data set be the result of constructing the form data set for form in the context of submitter.
Let action be the submitter element's action.
If action is the empty string, let action be the document's address of the form document.
Resolve the URL action, relative to the submitter element. If this fails, abort these steps.
Let action be the resulting absolute URL.
Let action components be the resulting parsed URL.
Let scheme be the scheme of the resulting parsed URL.
Let enctype be the submitter element's enctype.
Let method be the submitter element's method.
Let target be the submitter element's target.
If the user indicated a specific browsing context to use when submitting the form, then let target browsing context be that
browsing context. Otherwise, apply the rules for choosing a
browsing context given a browsing context name using target as
the name and form browsing context as the context in which the
algorithm is executed, and let target browsing context be the
resulting browsing context.
If target browsing context was created in the previous step, or, alternatively, if the form document has not yet completely
loaded and the submitted from submit()
method flag is
set, then let replace be true. Otherwise, let it be false.
Otherwise, select the appropriate row in the table below based on the value of scheme as given by the first cell of each row. Then,
select the appropriate cell on that row based on the value of method
as given in the first cell of each column. Then, jump to the steps
named in that cell and defined below the table.
| GET | POST
-------------------------------------------------------
http | Mutate action URL | Submit as entity body
https | Mutate action URL | Submit as entity body
ftp | Get action URL | Get action URL
javascript | Get action URL | Get action URL
data | Get action URL | Post to data:
mailto | Mail with headers | Mail as body
If scheme is not one of those listed in this table, then the behavior is not defined by this specification. User agents should, in
the absence of another specification defining this, act in a manner
analogous to that defined in this specification for similar schemes.