After entering data for all fields and submitting the form, we see our confirmation
page displayed in the browser.
Notice that our form has a couple of required fields. If a user attempts to submit
the form without entering any data in the required fields, the labels for the fields
will turn red, indicating that there is a problem with the data input for those fields.
Although it is nice that we get that functionality with no effort on our part, we
should display an error message explaining the problem to the user. There are
several ways to do this; we will explain three of the most common methods.
Adding a Message Component to Each Input Field
The first approach we can use to add descriptive error messages to the page is to
drop Message components next to each input field in the page.