jquery-mobile/docs/forms/docs-forms.html

45 lines
1.4 KiB
HTML
Raw Normal View History

2010-10-12 22:15:52 +00:00
<!DOCTYPE html>
<html>
<head>
<title>jQuery Mobile Docs - Forms</title>
<link rel="stylesheet" href="../../themes/default" />
2010-10-12 22:15:52 +00:00
<script type="text/javascript" src="../../js/all"></script>
<script type="text/javascript" src="../docs/docs.js"></script>
</head>
<body>
<div data-role="page">
<div data-role="header" data-theme="d">
2010-10-12 22:15:52 +00:00
<h1>Forms</h1>
</div><!-- /header -->
<div data-role="content">
2010-10-13 17:44:56 +00:00
<p>jQuery Mobile provides a complete set of finger-friendly form elements that are based on native HTML form elements.</p>
<h2>Form structure</h2>
2010-10-13 17:44:56 +00:00
<p>All forms should be wrapped in a <code>form</code> tag that has an <code>action</code> and <code>method</code> that will handle the form data processing on the server.</p>
<code>
&lt;form action=&quot;form.php&quot; method=&quot;post&quot;&gt;
...
&lt;/form&gt;
</code>
<h2>Grouping elements</h2>
<p>To group the label and form element together for styling, we recommend wrapping a <code>div</code> or <code>fieldset </code>with the <code>data-role="fieldcontain"</code> attribute. The framework will add a thin vertical line above this container to separate it visually from the next field.</p>
2010-10-13 17:44:56 +00:00
<pre><code>
&lt;div data-role=&quot;fieldcontain&quot;&gt;
...label/input code goes here...
&lt;/div&gt;
</pre></code>
2010-10-12 22:15:52 +00:00
</div><!-- /content -->
</div><!-- /page -->
</body>
</html>