Skip to Content
jQuery Mobile: Up and Running
book

jQuery Mobile: Up and Running

by Maximiliano Firtman
February 2012
Beginner to intermediate
272 pages
6h 20m
English
O'Reilly Media, Inc.
Content preview from jQuery Mobile: Up and Running

Chapter 5. Form Components

The jQuery Mobile framework supports standard web forms with automatic AJAX handling on compatible devices and with touch-optimized rendering for standard form controls. That’s the first good news about form controls.

When I say standard web form I’m talking about a group of form controls—such as input, textarea, and select elements—inside a form element with an action attribute defined as the URL that will receive the form’s data.

Form Action

Any form action will be handled as we expect. That is, the form will be submitted when the user presses a submit button or when the user presses the Enter key. Did I say Enter key on a mobile device?

We are going to target different devices with different input handling. Some of them will have physical keyboards (maybe with an Enter key); some others will only have a virtual onscreen keyboard. Devices with a virtual keyboards usually have a “send,” “submit,” or similar button on the keyboard that acts as the submit button while the user is entering form data.

When the form is submitted, jQuery Mobile will use an AJAX transition to the submission page similar to a link to an external page, unless the form is submitted to another domain. The form can use get or post defined in the action attribute of the form element.

A typical jQuery Mobile form will look very similar to a typical web form:

<form action="send.php" action="get">

</form>

A jQuery Mobile form needs a jQuery Mobile document on the results page, similar to an ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

jQuery Mobile

jQuery Mobile

Jon Reid

Publisher Resources

ISBN: 9781449331085Errata Page