Skip to content

Commit ab7246d

Browse files
committed
Define an optional value and use it for setting dialog returnValue
Define a new 'optional value' for buttons and submit inputs, this is used instead of 'value' when setting a dialog's returnValue.
1 parent 4ae3173 commit ab7246d

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

source

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51410,6 +51410,10 @@ ldh-str = &lt; as defined in <a href="https://www.rfc-editor.org/rfc/rfc10
5141051410

5141151411
<div w-nodev>
5141251412

51413+
<p>The element's <span data-x="concept-fe-optional-value">optional value</span> is the value of
51414+
the element's <code data-x="attr-button-value">value</code> attribute, if there is one, or null
51415+
otherwise.</p>
51416+
5141351417
<p>The element's <span>input activation behavior</span> given <var>event</var> is as follows:</p>
5141451418

5141551419
<ol>
@@ -53865,7 +53869,9 @@ interface <dfn interface>HTMLButtonElement</dfn> : <span>HTMLElement</span> {
5386553869
<p>The <dfn element-attr for="button"><code data-x="attr-button-value">value</code></dfn>
5386653870
attribute gives the element's value for the purposes of form submission. The element's <span
5386753871
data-x="concept-fe-value">value</span> is the value of the element's <code
53868-
data-x="attr-button-value">value</code> attribute, if there is one, or the empty string
53872+
data-x="attr-button-value">value</code> attribute, if there is one, or the empty string otherwise.
53873+
The element's <span data-x="concept-fe-optional-value">optional value</span> is the value of the
53874+
element's <code data-x="attr-button-value">value</code> attribute, if there is one, or null
5386953875
otherwise.</p>
5387053876

5387153877
<p class="note">A button (and its value) is only included in the form submission if the button
@@ -56648,6 +56654,11 @@ interface <dfn interface>HTMLLegendElement</dfn> : <span>HTMLElement</span> {
5664856654
default value. If it is false, <span data-x="concept-fe-value">value</span> mirrors the default
5664956655
value. If it is true, the default value is ignored.</p>
5665056656

56657+
<p>Some form controls also have an <dfn data-x="concept-fe-optional-value">optional value</dfn>
56658+
this largely mirrors the <span data-x="concept-fe-value">value</span> but doesn't normalize to an
56659+
empty string. <span class="note">This <!--non-normative-->should be used sparingly you generally
56660+
want <span data-x="concept-fe-value">value</span></span>.</p>
56661+
5665156662
<p><code>input</code>, <code>textarea</code>, and <code>select</code> elements have a
5665256663
<dfn>user validity</dfn> boolean. It is initially set to false.</p>
5665356664

@@ -60398,8 +60409,9 @@ fur
6039860409
</ol>
6039960410
</li>
6040060411

60401-
<li><p>Otherwise, if <var>submitter</var> has a <span data-x="concept-fe-value">value</span>,
60402-
then set <var>result</var> to that <span data-x="concept-fe-value">value</span>.</p></li>
60412+
<li><p>Otherwise, if <var>submitter</var> has an <span
60413+
data-x="concept-fe-optional-value">optional value</span>, then set <var>result</var> to that
60414+
<span data-x="concept-fe-optional-value">optional value</span>.</p></li>
6040360415

6040460416
<li><p><span>Close the dialog</span> <var>subject</var> with <var>result</var>.</p></li>
6040560417

@@ -62609,7 +62621,7 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
6260962621

6261062622
<ol>
6261162623
<li><p>Let <var>value</var> be <var>invoker</var>'s <span
62612-
data-x="concept-fe-value">value</span>.</p></li>
62624+
data-x="concept-fe-optional-value">optional value</span>.</p></li>
6261362625

6261462626
<li><p><span>Close the dialog</span> <var>element</var> with <var>value</var>.</p></li>
6261562627
</ol>

0 commit comments

Comments
 (0)