Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

form docs whitespace

  • Loading branch information...
commit 9fa45e430569de745709e4f5f3b528088aba9e43 1 parent f306382
@johnbender johnbender authored
Showing with 20 additions and 21 deletions.
  1. +20 −21 docs/forms/docs-forms.html
View
41 docs/forms/docs-forms.html
@@ -44,7 +44,7 @@
<p>For a more compact version of all form elements and buttons, add the <code>data-mini="true"</code> attribute to the element to create a <a href="forms-all-mini.html">mini version</a>. This is useful in toolbars and tight spaces but is still finger-friendly. It's possible to add this attribute to a fieldcontainer to set this on a number of elements at once.</p>
-<pre><code>
+<pre><code>
&lt;label for=&quot;basic&quot;&gt;Text Input:&lt;/label&gt;
&lt;input type=&quot;text&quot; name=&quot;name&quot; id=&quot;basic&quot; <strong>data-mini=&quot;true&quot;</strong> /&gt;
</code></pre>
@@ -84,12 +84,12 @@
<h2>Disabling form elements</h2>
<p>All jQuery Mobile widgets can be disabled in the markup by adding the standard <code>disabled</code> attribute to the element, just like you would with native controls. Each form widget also has standard <code>disable</code> and <code>enable</code> methods that are documented with each form widget. Here are a few examples of disabled widgets: </p>
-
+
<div data-role="fieldcontain">
<label for="foo">Text Input:</label>
<input type="text" name="name" id="foo" value="" disabled />
</div>
-
+
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<legend>Gender:</legend>
@@ -107,13 +107,13 @@
<option value="off">Off</option>
<option value="on">On</option>
</select>
- </div>
+ </div>
<div data-role="fieldcontain">
<label for="slider">Max bandwidth:</label>
<input type="range" name="slider" id="slider" value="0" min="0" max="100" disabled />
</div>
-
+
<div data-role="fieldcontain">
<label for="select-choice-x" class="select">Shipping:</label>
<select name="select-shipper" id="select-choice-x" disabled>
@@ -123,10 +123,10 @@
<option value="express">Express</option>
<option value="overnight">Overnight</option>
</select>
- </div>
-
+ </div>
+
<p>Note that you can disable buttons created from <code>button</code> or <code>input</code>-based markup, but not links with a role of button. Links don't have a parallel disabled feature in HTML, but if you need to disable a link-based button (or any element), it's possible to apply the disabled class <code>ui-disabled</code> yourself with JavaScript to achieve the same effect. </p>
-
+
<h2>Field containers</h2>
<p>To improve the styling of labels and form elements on wider screens, wrap a <code>div</code> or <code>fieldset </code>with the <code> data-role="fieldcontain"</code> attribute around each label/form element. This framework aligns the input and associated label side-by-side, and breaks to stacked block-level elements below ~480px. The framework will also add a thin bottom border to act as a field separator.</p>
@@ -149,13 +149,13 @@
</div>
<p>For additional examples, see the <a href="forms-all.html">form elements gallery</a></p>
-
-
+
+
<h2>Auto-initialization of form elements</h2>
<p>By default, jQuery Mobile will automatically enhance certain native form controls into rich touch-friendly components. This is handled internally by finding form elements by tag name and running a plugin method on them. For instance, a <code>select</code> element will be found and initialized with the "selectmenu" plugin, while an <code>input</code> element with a <code>type="checkbox"</code> will be enhanced with the "checkboxradio" plugin. Once initialized, you can address these enhanced components programmatically through their jQuery UI widget API methods. See options, methods, and events listed on each form plugin's documentation page for details. </p>
- <h2>Initializing groups of dynamically-injected form elements</h2>
- <p>If you should generate new markup client-side or load in content via AJAX and inject it into a page, you can trigger the <code>create</code> event to handle the auto-initialization for all the plugins contained within the new markup. This can be triggered on any element (even the page div itself), saving you the task of manually initializing each plugin (see below).</p>
+ <h2>Initializing groups of dynamically-injected form elements</h2>
+ <p>If you should generate new markup client-side or load in content via AJAX and inject it into a page, you can trigger the <code>create</code> event to handle the auto-initialization for all the plugins contained within the new markup. This can be triggered on any element (even the page div itself), saving you the task of manually initializing each plugin (see below).</p>
<p>For example, if a block of HTML markup (say a login form) was loaded in through Ajax, trigger the create event to automatically transform all the widgets it contains (inputs and buttons in this case) into the enhanced versions. The code for this scenario would be:</p>
@@ -218,18 +218,17 @@
<p>One special case is that of selects. The above sample will prevent any and all augmentation from taking place on select elements in the page if <code>select</code> is included. If you wish to retain the native performance and appearance of the menu itself and benefit from the visual augmentation of the select button by jQuery Mobile, you can set <code>$.mobile.selectmenu.prototype.options.nativeMenu</code> to true in a <code>mobileinit</code> callback as a global setting or use <code>data-native-menu="true"</code> on a case by case basis.</p>
-
</div><!--/content-primary -->
<div class="content-secondary">
-
+
<div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
-
+
<h3>More in this section</h3>
-
+
<ul data-role="listview" data-theme="c" data-dividertheme="d">
-
+
<li data-role="list-divider">Form elements</li>
<li data-theme="a"><a href="docs-forms.html">Form basics</a></li>
<li><a href="forms-all.html">Form element gallery</a></li>
@@ -244,18 +243,18 @@
<li><a href="forms-themes.html">Theming forms</a></li>
<li><a href="forms-all-native.html">Native form elements</a></li>
<li><a href="forms-sample.html">Submitting forms</a></li>
-
-
+
+
</ul>
</div>
- </div>
+ </div>
</div><!-- /content -->
<div data-role="footer" class="footer-docs" data-theme="c">
<p>&copy; 2011-12 The jQuery Project</p>
</div>
-
+
</div><!-- /page -->
</body>
Please sign in to comment.
Something went wrong with that request. Please try again.