Book Image

Mastering jQuery Mobile

Book Image

Mastering jQuery Mobile

Overview of this book

Table of Contents (17 chapters)
Mastering jQuery Mobile
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Forms and validation


So far we have only created a database table and fetched the data from it. We haven't seen how we can post data to a database table. Over the course of the next couple of sections, we will see how we can post the data from the frontend to the database via PHP. In order to do that, we will create a form that accepts some values and we will post these values to the database. However, before posting these values, we will validate these form fields on the frontend.

Let's consider a scenario where a user of the Civic Center application wants to make a reservation for an event he/she wishes to host at one of the facilities the Civic Center provides. We will create a form that asks the user for some details, so that when the user submits these, the authorities at the Civic Center can get in touch with the customer. We will create a new page inside the index.php file with id="contact" and the user will be able to access this page from the Home page, where we will add a link to...