How to customize the error message for required field in touch Ui in AEM | Community
Skip to main content
Anderson_Hamer
Level 4
July 24, 2021
Solved

How to customize the error message for required field in touch Ui in AEM

  • July 24, 2021
  • 3 replies
  • 4411 views

I know we can make use of required boolean property to make the field as required. If you dont enter any field in dialog, aem gives "Please fill out this field." as per the default implementation. Can we change this error message with any property?

 

I referred this API link - https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/textfield/index.html but this does not have any relevant  property to customize error message. Can anyone tried to change this default error msg?

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 arunpatidar

Hi,

Unfortunately, there is no property/option to set custom messages or use regex like the classic UI widget.

for the same reason, I also end up creating a custom solution https://aemlab.blogspot.com/2019/05/aem-touch-ui-component-dialog-field.html

 

If you want to change a message you can simply generic solution to overwrite the OOTB message with a custom message. you can use coral alert api combination with custom error message property https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/coral-ui/coralui3/Coral.Alert.html#Coral.Alert:api

 

 

3 replies

Kiran_Vedantam
Community Advisor
Community Advisor
July 25, 2021

Hi @anderson_hamer,

 

Please check this link for your use case: https://aemhints.com/2020/11/02/validating-dialog-value/

 

Thanks,

Kiran Vedantam.

Anderson_Hamer
Level 4
July 25, 2021
What you are mentioning it custom validation. I dont want to do any custom validation. just want to make it as required field. The OOTB required proper will do the job but just want to change the default error message to something else.
arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
July 25, 2021

Hi,

Unfortunately, there is no property/option to set custom messages or use regex like the classic UI widget.

for the same reason, I also end up creating a custom solution https://aemlab.blogspot.com/2019/05/aem-touch-ui-component-dialog-field.html

 

If you want to change a message you can simply generic solution to overwrite the OOTB message with a custom message. you can use coral alert api combination with custom error message property https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/coral-ui/coralui3/Coral.Alert.html#Coral.Alert:api

 

 

Arun Patidar
June 17, 2022

A.M.E. is not for the spanish?.