concept edit - book form in category aurelia

appears as: edit-book form, The edit-book form, Edit-book form, edit-books form
Aurelia in Action

This is an excerpt from Manning's book Aurelia in Action.

With the Aurelia-validation plugin installed and registered with your Aurelia application, you can now put it to use by adding validation to the edit-book form.

With our vision laid out for where we want to go with the edit-book form, let’s dive right in and start making the required changes. In the next section, you’ll initiate these changes by adding the own-a-copy check-box binding.

Let’s see the radio functionality in action and use it to implement an initial version of a genre-selection control in the edit-book form, as shown in figure 7.3.

Figure 7.3. The edit-book form modified to include a radio control to allow users to select a book’s genre. This uses a Checked binding command and a repeater to render and bind an input field for each genre in the genres array on the EditBook view-model.

Because you want the edit-book form to use Bootstrap 4 styling without the need for additional validation markup in the view, you need to implement a custom validation renderer. In case you’re wondering why you focus on the renderer first, this component is configured during validation-controller implementation on the view-model (step 2). You don’t need to have this in place before starting step 2, but in this case, it saves you circling back to it later. The implementation details for this renderer aren’t important at the moment, so you can take a shortcut by adding a validation renderer provided by the Aurelia core team on the Aurelia Hub: http://aurelia.io/docs/plugins/validation#validator. I’ve taken the Bootstrap 3 validation renderer provided in the documentation and modified it to work with Bootstrap 4 styles.