Achieving Client-Side Validation with VeeValidate
A website is not complete until it has a form of some sort. Contact Us, feedback, and comment forms are just a few examples that we may be required to develop and validate in our Vue.js application.
In this chapter, we will explain what makes a semantically correct form, introduce the available fields, and talk through its accessibility needs. We will then update our CreatePost
component and learn how to handle form fields and manage two-way binding using v-model
. Next, we will move on to creating a new form called contactUs
. This will be used to introduce a new package called VeeValidate. Finally, we will learn how to develop custom validation rules and how to simplify our validation by using VeeValidate preset rules.
In this chapter, we will cover the following:
- Understanding forms
- Two-way binding with
v-model
- Controlling your form using VeeValidate
- Defining your form validation with VeeValidate
By...