Book Image

jQuery Mobile First Look

Book Image

jQuery Mobile First Look

Overview of this book

Table of Contents (17 chapters)
jQuery Mobile First Look
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Form basics


First things first: all of the elements we might ever need in order to create a form (that is, inputs, buttons, switches, and so forth) are built by the jQuery Mobile framework on top of standard (native) HTML elements.

By creating a custom element, jQuery Mobile is thus able to provide a visually more appealing set of buttons and inputs to A-grade (and B-grade as well) mobile browsers. On lower-graded platforms (C-grade), no JavaScript or CSS is applied, and therefore plain HTML elements are used.

In a nutshell, jQuery Mobile applies its scripting to mobile devices which are known to support it and render the page correctly. Other browsers will fall back to a standard display as if jQuery Mobile was not used at all.

Form structure and initialization

Given the way in which the framework behaves, there are only a few differences we need to point out in order to create forms.

Basically, all forms should be constructed following the standard guidelines we would use in plain HTML: we...