An HTML5 web form
We'll get started by taking advantage of some of the new attributes made available to us in HTML5. The great thing about these additions is that they are completely backward compatible—browsers that don't know how to handle them will either ignore them or default to a simple text input, and our site visitors on older browsers will be able to use our forms without even knowing what they're missing.
First, a word of caution about web forms. A web form doesn't work by itself—it needs to have some fancy backend programming on a server somewhere to collect the form entries and process them, which could mean writing fields to the database or sending the form information via an e-mail. Because of this, the forms we build in this chapter won't actually function—nothing will happen after clicking on the Submit button on the form. If you want to add a functioning web form to a project, you have a few options, which are as follows:
- You...