Skip to content
Permalink
Browse files

Add form.requestSubmit()

  • Loading branch information...
domenic committed May 16, 2019
1 parent 1d112e1 commit e0742f8fdf3b119fdabdcad01d2ebfef1d7a2262
Showing with 49 additions and 1 deletion.
  1. +49 −1 source
50 source
<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>();

<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>

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>

Malcolm Rowe,
Manish Goregaokar,
Manish Tripathi,
Manuel Martinez-Almeida,
Marc Hoyois,
Marc-André Choquette, <!-- eel-in-a-hovercraft on GitHub -->
Marc-André Lafortune,
Mounir Lamouri,
Ms2ger,
mtrootyy,
邱慕安 (Mu-An<!--grammar-check-override--> Chiou),
Mukilan Thiyagarajan,
Mustaq Ahmed,
Nadia Heninger,

0 comments on commit e0742f8

Please sign in to comment.
You can’t perform that action at this time.