Form Validation
Let's see how to validate form data.
Stopping execution of the wrong data
Instead of saving an empty destination, we would want to say to the user: “Please fill in a destination”. Preferably, we would show this message next to the form field that it applies to. We can do this by taking a closer look at the submitted data and by stopping the execution if there’s something wrong:
Get hands-on with 1400+ tech skills courses.