Book Image

jQuery 2.0 Development Cookbook

By : Leon Revill
Book Image

jQuery 2.0 Development Cookbook

By: Leon Revill

Overview of this book

Table of Contents (17 chapters)
jQuery 2.0 Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding date picker interfaces to input boxes quickly


Date pickers provide the user with an easy-to-use interface to allow them to quickly select the date they require. jQuery UI provides a date picker that can be quickly added to input fields. The date picker provides many configuration options such as date formatting and restrictions, making it easier for the developer to limit the user's input accordingly. This recipe will show you how to add the date picker to two input fields, change the date format of the date pickers, and also apply date limits to each of the fields.

Getting ready

As with the previous recipe, create recipe-4.html, recipe-4.js, and recipe-4.css within the chapter9 folder you created earlier.

How to do it…

Perform each of the following steps to create a simple interface with two date pickers and configuration options:

  1. Insert the following HTML code into recipe-4.html to create the basic web page and UI with date picker elements:

    <!DOCTYPE html>
    <html>
    <head...