How to add email validation to the text field in aem? | Community
Skip to main content
Adobe Employee
September 1, 2022
Solved

How to add email validation to the text field in aem?

  • September 1, 2022
  • 2 replies
  • 1366 views

Hi,

I need to enable validation for custom textfield in page properties. How to write js for email validation?

Thank you 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by HeenaMadan

You need to write custom javascript to validate email field. Use regex to validate email format. Refer https://github.com/techforum-repo/youttubedata/blob/master/aem/custom-validation-multifields-1.0.zip

to get validation.js for email validtaion.

2 replies

Pallavi_Shukla_
Community Advisor
Community Advisor
September 1, 2022

hi @keerthana_h_n 

 

Please check this blog - it has sample js written for email validation

 

https://www.albinsblog.com/2018/09/how-to-enable-custom-validation-on-multifield-touch-ui-aem.html#.YxCP8nZBy5c

HeenaMadan
Community Advisor and Adobe Champion
HeenaMadanCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
September 1, 2022

You need to write custom javascript to validate email field. Use regex to validate email format. Refer https://github.com/techforum-repo/youttubedata/blob/master/aem/custom-validation-multifields-1.0.zip

to get validation.js for email validtaion.