Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Validate Touch Ui Dialog

Avatar

Level 2

Hi I have Touch Ui Dialog, in that dialog I have 5 fields are there. So when author open dialog and submit without author anything [all dialog fields are empty] on that time we have to show alert like "No value entered .please add at least one of the field..."

 

Rajini_1-1663945075014.png

 

Rajini_0-1663944945518.png

 

Please help me

thanks in advance

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Below are the couple of helpful links to go through to set up the custom validation in touch UI dialog. Its pretty straight forward

https://blogs.perficient.com/2017/11/06/aem-touch-ui-dialog-validation-new-best-practice-use-foundat...

https://medium.com/@ramamity94/easily-achieving-dialog-validations-in-aem-touch-ui-e78106012282

https://aemhints.com/2020/11/02/validating-dialog-value/

 

Or if these fields are mandatory you can set the 

required="{Boolean}true"

 for those fields in the dialog.

 

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

Below are the couple of helpful links to go through to set up the custom validation in touch UI dialog. Its pretty straight forward

https://blogs.perficient.com/2017/11/06/aem-touch-ui-dialog-validation-new-best-practice-use-foundat...

https://medium.com/@ramamity94/easily-achieving-dialog-validations-in-aem-touch-ui-e78106012282

https://aemhints.com/2020/11/02/validating-dialog-value/

 

Or if these fields are mandatory you can set the 

required="{Boolean}true"

 for those fields in the dialog.

 

Avatar

Community Advisor

Hi @Rajini 

 

It seems you wanted an alert as a popup to show what are mandatory fields. Example urls from @Saravanan_Dharmaraj  also works with in the dialog but not sure if it can show as a alert popup. For this you might need to add a custom JS to show the message on a dialog. Please refer to below example you can use it and customize it according to your requirement. Hope that works for you

 

https://aemlab.blogspot.com/2019/05/aem-touch-ui-component-dialog-field.html