+ Start a Discussion
Soundar Raj PonpandiSoundar Raj Ponpandi 

Email Validation in Lightning Component

Hi,

I am looking for a email validation in lightning component.

1. Is that possible by using in a component ? without using controller or helper ?

2. If No, Can you guide me to get a following email validation.

3.  It should end with ( .COM). Let's say for example it should the validation if it's  in following format " abc@d.o " .


Regards,
Soundar.
Best Answer chosen by Soundar Raj Ponpandi
Abdul KhatriAbdul Khatri

Hi Soundar

why don't you use email input type
https://developer.salesforce.com/docs/component-library/bundle/lightning-input/documentation

lightning-input type="email"
                     label="Email">
    </lightning-input>

it has all the validation buolt in

All Answers

Abdul KhatriAbdul Khatri

Hi Soundar

why don't you use email input type
https://developer.salesforce.com/docs/component-library/bundle/lightning-input/documentation

lightning-input type="email"
                     label="Email">
    </lightning-input>

it has all the validation buolt in
This was selected as the best answer
Soundar Raj PonpandiSoundar Raj Ponpandi
Hi Abdul,

Perfect .... It's working very cool. We don't need componnet and controller.JS

Thansk for your valuable input.

Regards,
Soundar.
Bates andersonBates anderson
Thanks for the information keep sharing such information alaskasworld (https://www.alaskasworld.me/)
Thanks about Email Validation in Lightning Component