You are previewing HTML5 Foundations.

HTML5 Foundations

Cover of HTML5 Foundations by Matthew West Published by John Wiley & Sons

chapter five

Working with Forms

The World Wide Web is the single greatest tool ever invented for collecting information. Web forms are responsible for this. We use them every day, whether we are purchasing something online, doing research using our favorite search engine, or logging into our e-mail. Web forms have become an essential part of our everyday browsing experience; in fact, without them, the Internet would be a rather dull place (yes, really).

Joe’s website needs a web form so that customers can book a table directly through the website. This chapter teaches you how to create a simple web form and embed it within your web pages. First, you will create the new Bookings page with a barebones form. Once you have your page set up, you will start adding a number of different form fields to it using a range of HTML elements, such as <input>, <label>, <select>, and <textarea>. You will finish by updating the site navigation and sitemap to include the new Bookings page.

In this chapter you are just going to focus on creating a basic form using elements that were present in HTML4. Once you have this form set up, Chapters 6 and 7 will teach you how to use new HTML5 features to enhance your web forms. These new features include specialized input types that make it easier for users to input data and tools for validating the data inputted by users. Figure 5-1 shows the completed Bookings page that you will be building in these three chapters.

Figure 5-1 The completed Bookings page, ...

The best content for your career. Discover unlimited learning on demand for around $1/day.