CHAPTER 3

Working with Forms

By no means are forms the most exciting part of web development. Indeed, although data entry is probably one of the least exciting technological fields, it’s still one of the most crucial. And armed with a few smart techniques and CoffeeScript, you can do a lot with forms with very little effort.

For a number of years, it seemed as though the technical standards for web forms had stagnated. Although forms were implemented consistently across browsers and could generally be styled using CSS in any way a developer pleased, there were also a number of missing features that led people to develop client-side solutions, using JavaScript, to address many of the shortcomings.

HTML 5 has changed that, and new features for data form features available in recent browsers can be adapted for older clients, using standard polyfill techniques. However, form logic for the client-side definitely still plays a role, and this chapter covers the tools and techniques of CoffeeScript and jQuery as they apply to forms. By the end of the chapter, you’ll know how to create interactive forms with sophisticated features to improve the user experience and how to apply these techniques to a variety of forms commonly implemented on websites.

Basic HTML5 forms

Before looking at how to work with forms in CoffeeScript, take a look at the forms themselves and how to implement them in HTML 5. Giving users the ability to log in to a website by providing a username and password is a ...

Get Smashing CoffeeScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.