Skip to content

Commit

Permalink
Add form.requestSubmit()
Browse files Browse the repository at this point in the history
  • Loading branch information
domenic committed May 16, 2019
1 parent 1d112e1 commit e0742f8
Showing 1 changed file with 49 additions and 1 deletion.
50 changes: 49 additions & 1 deletion source
Original file line number Diff line number Diff line change
Expand Up @@ -43117,6 +43117,7 @@ interface <dfn>HTMLFormElement</dfn> : <span>HTMLElement</span> {
<a href="#dom-form-nameditem">getter</a> (<span>RadioNodeList</span> or <span>Element</span>) (DOMString name);

void <span data-x="dom-form-submit">submit</span>();
void <span data-x="dom-form-requestSubmit">requestSubmit</span>(optional <span>HTMLElement</span> submitter);
[<span>CEReactions</span>] void <span data-x="dom-form-reset">reset</span>();
boolean <span data-x="dom-form-checkValidity">checkValidity</span>();
boolean <span data-x="dom-form-reportValidity">reportValidity</span>();
Expand Down Expand Up @@ -43228,7 +43229,30 @@ interface <dfn>HTMLFormElement</dfn> : <span>HTMLElement</span> {

<dd>

<p>Submits the form.</p>
<p>Submits the form, bypassing <span data-x="interactively validate the constraints">interactive
constraint validation</span> and without firing a <code data-x="event-submit">submit</code>
event.</p>

</dd>

<dt><var>form</var> . <code subdfn data-x="dom-form-requestSubmit">requestSubmit</code>( [ <var>submitter</var> ] )</dt>

<dd>

<p>Requests to submit the form. Unlike <code data-x="dom-form-submit">submit()</code>, this
method includes <span data-x="interactively validate the constraints">interactive constraint
validation</span> and firing a <code data-x="event-submit">submit</code> event, either of which
can cancel submission.</p>

<p>The <var>submitter</var> argument can be used to point to a specific <span
data-x="concept-submit-button">submit button</span>, whose <code
data-x="attr-fs-formaction">formaction</code>, <code
data-x="attr-fs-formenctype">formenctype</code>, <code
data-x="attr-fs-formmethod">formmethod</code>, <code
data-x="attr-fs-formnovalidate">formnovalidate</code>, and <code
data-x="attr-fs-formtarget">formtarget</code> attributes can impact submission. Additionally,
the submitter will be included when <span>constructing the entry list</span> for submission;
normally, buttons are excluded.</p>

</dd>

Expand Down Expand Up @@ -43458,6 +43482,28 @@ interface <dfn>HTMLFormElement</dfn> : <span>HTMLElement</span> {
element itself, with the <var>submitted from <code
data-x="dom-form-submit">submit()</code> method</var> flag set.</p>

<p>The <dfn><code data-x="dom-form-requestSubmit">requestSubmit(<var>submitter</var>)</code></dfn>
method, when invoked, must run the following steps:</p>

<ol>
<li>
<p>If <var>submitter</var> was given, then:</p>

<ol>
<li><p>If <var>submitter</var> is not a <span data-x="concept-submit-button">submit
button</span>, then throw a <code>TypeError</code>.</p></li>

<li><p>If <var>submitter</var>'s <span>form owner</span> is not this <code>form</code> element,
then throw a <span>"<code>NotFoundError</code>"</span> <code>DOMException</code>.</p></li>
</ol>
</li>

<li><p>Otherwise, set <var>submitter</var> to this <code>form</code> element.</p></li>

<li><p><span data-x="concept-form-submit">Submit</span> this <code>form</code> element, from
<var>submitter</var>.</p></li>
</ol>

<p>The <dfn><code data-x="dom-form-reset">reset()</code></dfn> method, when invoked, must run the
following steps:</p>

Expand Down Expand Up @@ -123125,6 +123171,7 @@ INSERT INTERFACES HERE
Malcolm Rowe,
Manish Goregaokar,
Manish Tripathi,
Manuel Martinez-Almeida,
Marc Hoyois,
Marc-André Choquette, <!-- eel-in-a-hovercraft on GitHub -->
Marc-André Lafortune,
Expand Down Expand Up @@ -123214,6 +123261,7 @@ INSERT INTERFACES HERE
Mounir Lamouri,
Ms2ger,
mtrootyy,
邱慕安 (Mu-An<!--grammar-check-override--> Chiou),
Mukilan Thiyagarajan,
Mustaq Ahmed,
Nadia Heninger,
Expand Down

0 comments on commit e0742f8

Please sign in to comment.