Expand my Community achievements bar.

SOLVED

How is the validation done in aem forms?

Avatar

Level 1

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.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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

View solution in original post

1 Reply

Avatar

Correct answer by
Employee Advisor

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