Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

docs form samples whitespace

  • Loading branch information...
commit f30638225e41fa4a94cabad356a61247883d3c42 1 parent 94c0aeb
@johnbender johnbender authored
Showing with 16 additions and 16 deletions.
  1. +16 −16 docs/forms/forms-sample.html
32 docs/forms/forms-sample.html
@@ -1,9 +1,9 @@
-<!DOCTYPE html>
+<!DOCTYPE html>
<meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>jQuery Mobile Docs - Sample Form Submit</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>jQuery Mobile Docs - Sample Form Submit</title>
<link rel="stylesheet" href="../../css/themes/default/" />
<link rel="stylesheet" href="../_assets/css/jqm-docs.css"/>
@@ -11,8 +11,8 @@
<script src="../../docs/_assets/js/jqm-docs.js"></script>
<script src="../../js/"></script>
<div data-role="page" class="type-interior">
@@ -24,13 +24,13 @@
<div data-role="content">
<div class="content-primary">
<h2>Ajax form submission</h2>
<p>In jQuery Mobile, form submissions are automatically handled using Ajax whenever possible, creating a smooth transition between the form and the result page. To ensure your form submits as intended, be sure to specify <code>action</code> and <code>method</code> properties on your form element. When unspecified, the method will default to <code>get</code>, and the <code>action</code> will default to the current page's relative path (found via <code>$.mobile.path.get()</code>)</p>
<p>Forms also accept attributes for transitions just like anchors, such as <code>data-transition="pop"</code> and <code>data-direction="reverse"</code>. To submit a form without Ajax, you can either disable Ajax form handling globally, or per form via the <code>data-ajax="false"</code> attribute. The <code>target</code> attribute (as in <code>target="_blank"</code>) is respected on forms as well, and will default to the browser's handling of that target when the form submits. Note that unlike anchors, the <code>rel</code> attribute is not allowed on forms.</p>
<h2>Default Ajax form example</h2>
<p>This demonstrates automated ajax handling of form submissions. The form below is configured to send a <code>GET</code> request to <code>forms-sample-response.php</code>. On submit, jQuery Mobile will make sure that the Url specified is able to be retrieved via Ajax, and handle it appropriately. Keep in mind that just like ordinary HTTP form submissions, jQuery Mobile allows <code>GET</code> result pages to be bookmarked by updating the URL hash when the response returns successfully. Also like ordinary form submissions, <code>POST</code> requests do not contain query parameters in the hash, so they are not bookmarkable.</p>
<form action="forms-sample-response.php" method="get" class="ui-body ui-body-a ui-corner-all">
@@ -47,11 +47,11 @@
<button type="submit" data-theme="b" name="submit" value="submit-value">Submit</button>
<h2>Non-Ajax form example</h2>
<p>To prevent form submissions from being automatically handled with Ajax, add the <code>data-ajax="false"</code> attribute to the form element. You can also turn off Ajax form handling completely via the <code>ajaxEnabled</code> <a href="../api/globalconfig.html">global config option</a>.</p>
<p>The form below is identical to the one above except for the addition of the <code>data-ajax="false"</code> attribute. When the submit button is pressed, it will result in a full page refresh.</p>
<form action="forms-sample-response.php" method="get" data-ajax="false" class="ui-body ui-body-a ui-corner-all">
@@ -67,12 +67,12 @@
<button type="submit" data-theme="b" name="submit" value="submit-value">Submit</button>
<h2>Self-submitting Forms</h2>
<p>You can submit forms to the same URL you're currently viewing by setting the form's <code>action</code> attribute to that URL. <A href="forms-sample-selfsubmit.php">This page demonstrates.</a></p>
<p>When a <code>POST</code> request is submitted to a page that's already in the DOM (which would commonly happen when submitting a form to the same URL currently in view), the response URL will be identical to that existing page, as <code>POST</code> requests do not append query string parameters to the URL. In this situation, jQuery Mobile will replace the page that submitted the form with the page returned in the response body.</p>
- </div><!--/content-primary -->
+ </div><!--/content-primary -->
<div class="content-secondary">
@@ -86,7 +86,7 @@
<li><a href="docs-forms.html">Form basics</a></li>
<li><a href="forms-all.html">Form element gallery</a></li>
<li><a href="forms-all-mini.html">Mini form element gallery</a></li>
- <li><a href="textinputs/">Text inputs</a></li>
+ <li><a href="textinputs/">Text inputs</a></li>
<li><a href="search/">Search inputs</a></li>
<li><a href="slider/">Slider</a></li>
<li><a href="switch/">Flip toggle switch</a></li>
@@ -96,11 +96,11 @@
<li><a href="forms-themes.html">Theming forms</a></li>
<li><a href="forms-all-native.html">Native form elements</a></li>
<li data-theme="a"><a href="forms-sample.html">Submitting forms</a></li>
- </div>
+ </div>
</div><!-- /content -->
Please sign in to comment.
Something went wrong with that request. Please try again.