Custom Validation in a Lightning Input Field on Click Button

Vijay Kumar
2 min readJul 24, 2020
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.

Other related post that would you like to learn

formValidationCmp.cmp [Lightning Component]

formValidationCmpController.js [JavaScript File]

formValidationCmp.css [Style CSS File]

Originally published at https://www.w3web.net on July 24, 2020.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response