5 <meta name="viewport" content="width=device-width, initial-scale=1">
6 <title>jQuery Mobile Docs - Text Search options</title>
7 <link rel="stylesheet" href="../../../css/themes/default/jquery.mobile.css" />
8 <link rel="stylesheet" href="../../_assets/css/jqm-docs.css"/>
9 <script src="../../../experiments/themeswitcher/jquery.mobile.themeswitcher.js"></script>
10 <script src="../../../js/jquery.js"></script>
11 <script src="../../../docs/_assets/js/jqm-docs.js"></script>
12 <script src="../../../js/"></script>
17 <div data-role="page" class="type-interior">
19 <div data-role="header" data-theme="f">
21 <a href="../../../" data-icon="home" data-iconpos="notext" data-direction="reverse">Home</a>
22 <a href="../../nav.html" data-icon="search" data-iconpos="notext" data-rel="dialog" data-transition="fade">Search</a>
23 </div><!-- /header -->
25 <div data-role="content">
26 <div class="content-primary">
28 <form action="#" method="get">
32 <ul data-role="controlgroup" data-type="horizontal" class="localnav">
33 <li><a href="index.html" data-role="button" data-transition="fade">Basics</a></li>
34 <li><a href="options.html" data-role="button" data-transition="fade" class="ui-btn-active">Options</a></li>
35 <li><a href="methods.html" data-role="button" data-transition="fade">Methods</a></li>
36 <li><a href="events.html" data-role="button" data-transition="fade">Events</a></li>
39 <p>The text input plugin has the following options:</p>
42 <dt><code>initSelector</code> <em>CSS selector string</em></dt>
44 <p class="default">default: "input[type='text'], input[type='search'], :jqmData(type='search'), input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input:not([type])"</p>
45 <p>This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as textinputs. To change which elements are initialized, bind this option to the <a href="../../api/globalconfig.html">mobileinit event</a>:</p>
46 <pre><code>$( document ).bind( "mobileinit", function(){
47 <strong>$.mobile.textinput.prototype.options.initSelector = ".myInputs";</strong>
51 <dt><code>mini</code> <em>boolean</em></dt>
53 <p class="default">default: false</p>
54 <p>Sets the size of the element to a more compact, <a href="../forms-all-mini.html">mini version</a>. This option is also exposed as a data attribute: <code>data-mini="true"</code></p>
55 <pre><code>$('.selector').textinput(<strong>{ mini: "true" }</strong>);</code></pre>
56 <dt><code>theme</code> <em>string</em></dt>
58 <p class="default">default: null, inherited from parent</p>
59 <p>Sets the color scheme (swatch) for all instances of this widget. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, it will inherit the same swatch color as it's parent container if not explicitly set. This option is also exposed as a data attribute: <code>data-theme="a"</code></p>
60 <pre><code>$('.selector').textinput(<strong>{ theme: "a" }</strong>);</code></pre>
63 <dt><code>clearSearchButtonText</code> <em>string</em></dt>
65 <p class="default">default: "clear text"</p>
66 <p>Sets the text used for the button that clears the search input of text.</p>
67 <pre><code>$('.selector').textinput(<strong>{ clearSearchButtonText: "custom value" }</strong>);</code></pre>
73 </div><!--/content-primary -->
75 <div class="content-secondary">
77 <div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
79 <h3>More in this section</h3>
81 <ul data-role="listview" data-theme="c" data-dividertheme="d">
83 <li data-role="list-divider">Form elements</li>
84 <li><a href="../docs-forms.html">Form basics</a></li>
85 <li><a href="../forms-all.html">Form element gallery</a></li>
86 <li><a href="../forms-all-mini.html">Mini form element gallery</a></li>
87 <li><a href="../textinputs/index.html">Text inputs</a></li>
88 <li data-theme="a"><a href="index.html">Search input</a></li>
89 <li><a href="../slider/">Slider</a></li>
90 <li><a href="../switch/">Flip toggle switch</a></li>
91 <li><a href="../radiobuttons/">Radio buttons</a></li>
92 <li><a href="../checkboxes/">Checkboxes</a></li>
93 <li><a href="../selects/">Select menus</a></li>
94 <li><a href="../forms-themes.html">Theming forms</a></li>
95 <li><a href="../forms-all-native.html">Native form elements</a></li>
96 <li><a href="../forms-sample.html">Submitting forms</a></li>
103 </div><!-- /content -->
105 <div data-role="footer" class="footer-docs" data-theme="c">
106 <p>© 2011-12 The jQuery Foundation</p>