custom validation in a lightning component --

Custom Validation in a Lightning Input Field on Click Button

Hey guys, today in this post we are going to learn about How to create a form and validate all fields on a single click of button in lightning component.

Why are validation rules used?

We use form validation whenever we need to input information that is expected to some requirement from user.

There are two type of validation rule standards:- Server Side Validation and Client Side Validation.

Server Side Validation:- It is performed by server side. When we click on a button the button functionality call a method that is connected through server and it’s get all information from server.

Client Side Validation:- Client side validation performed by JavaScript function. Where does not need to connect to server. It is working very fast because it helps to reduce the server side lode.

In this example I am creating a client side validation. So go through the below points step by step.

Form Validation -

Other related post that would you like to learn


formValidationCmp.cmp [Lightning Component]


formValidationCmpController.js [JavaScript File]


formValidationCmp.css [Style CSS File]

Related further post that you want to learn

2 thoughts on “Custom Validation in a Lightning Input Field on Click Button”

Leave a Comment

Contribute to Support If Some Value Added in Your Project or Website