Chapter 7. Working with forms
This chapter covers
- Binding check boxes
- Binding select controls
- Binding radio elements
- Validating the my-books edit-book form using the Aurelia validation plugin
Forms are one of the primary ways that users interact with your website. Well-implemented forms make users happy. Conversely, poorly implemented forms can slow down or stop user activity on your site. You can address two of the main aspects of well-built forms using Aurelia’s binding and validation components. Binding can be used to provide rapid feedback, guiding the user on the correct form journey by making their next action obvious. Validation can be used to show users the feedback they need to submit the form in a way that’s unobtrusive and avoids breaking user flow. In this chapter, you’ll learn how to use the main HTML form elements that you’re used to, such as check boxes, radio elements, select controls, and text input, with Aurelia’s binding system. You’ll then learn how to add validation to your Aurelia forms using Aurelia’s validation plugin.
You’ll expand on the work that you started in chapter 4, enhancing the book-management functionality in my-books to allow for more-comprehensive edits on book metadata. These enhancements will include the following: