You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>To add a clear button to any input (like the search input), add the <code>data-clear-btn="true"</code> attribute. The text for this clear button can be customized via the <code>data-clear-btn-text="clear input"</code> attribute. Search buttons have the clear button by default but can be controlled by this option. Note that this is available for all the input types below except for <code>textareas</code>.</p>
<p>Optionally wrap the text input in a container with the <code> data-role="fieldcontain"</code> attribute to help visually group it in a longer form.</p>
@@ -86,69 +101,71 @@ <h2>More text input types</h2>
86
101
87
102
<p>One major advantage of using these more specific input types if that on mobile devices, specialized keyboards or pickers that speed data entry are offered in place of the standard text keyboard. Support for each input type will vary greatly across platforms, but these generally fall back to a basic text input if not understood.</p>
88
103
104
+
<p>Each of these inputs has the optional clear button, but browsers may not show the buttons in certain types.</p>
Copy file name to clipboardExpand all lines: docs/forms/textinputs/options.html
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,20 @@ <h2>Text inputs</h2>
38
38
<p>The text input plugin has the following options:</p>
39
39
40
40
<dl>
41
+
<dt><code>clearBtn</code><em>boolean</em></dt>
42
+
<dd>
43
+
<pclass="default">default: false</p>
44
+
<p>Adds a clear button to the input (not available for textareas). This option is also exposed as a data attribute: <code>data-clear-btn="true"</code></p>
<p>The text description for the optional clear button, useful for assistive technologies like screen readers. This option is also exposed as a data attribute: <code>data-clear-btn-text="Clear input"</code></p>
0 commit comments