How is the validation done in aem forms? | Community
Skip to main content
December 27, 2019
Solved

How is the validation done in aem forms?

  • December 27, 2019
  • 1 reply
  • 1722 views

I am new to aem form so please help?
How is the client-side and server-side validation done in aem forms exactly?
I have seen that there is a pattern field where you can give regex patterns to validate but how to add more complex business logic validations.
I have seen that in the code editor we can write logics but how do I set the field to invalid if the conditions fail?
And when I check the server-side revalidation will all my validations written in the code editor be revalidated on the server-side?

It would be helpful if you could provide a good article link on aem form field validation.

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 Mayank_Gandhi

If you have complex logic to validate then use code editor.

 

You need to choose the option "validate". The event checks for Boolean as return value, so your code logic should return either true or false. I would suggest start with a simple code in validate  and I will continue to share inputs with you.

 

Thanks,

Mayank

1 reply

Mayank_Gandhi
Adobe Employee
Mayank_GandhiAdobe EmployeeAccepted solution
Adobe Employee
January 6, 2020

If you have complex logic to validate then use code editor.

 

You need to choose the option "validate". The event checks for Boolean as return value, so your code logic should return either true or false. I would suggest start with a simple code in validate  and I will continue to share inputs with you.

 

Thanks,

Mayank