How to add a maximum limit for tags in dialog field | Community
Skip to main content
Level 5
May 11, 2023 4:30 PM UTC
Solved

How to add a maximum limit for tags in dialog field

<tags
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/coral/common/form/tagfield"
fieldLabel="Tags"
fieldDescription="Let author choose a maximum of five tags"
multiple="{Boolean}true"
name="./tags"
required="{Boolean}true"/>

 

above is the configured dialog, is there any way to limit the author to add only 5 tags.

Thanks in advance.

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

3 replies

Rohit_Utreja
New Participant
May 12, 2023 8:47 AM UTC

Hi @aravinds ,

 

Please have a look at a similar thread below.

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/restrict-tag-field-to-max-2-tags-touchui/m-p/440070

 

Just to give you a highlight, you need to write custom validations to achieve this.

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

 

I hope it helps!

Translate
Saravanan_Dharmaraj
Saravanan_DharmarajAccepted solution
New Participant
May 11, 2023 9:14 PM UTC
SantoshSai
New Participant
May 11, 2023 5:51 PM UTC

Hi @aravinds ,

 

Please refer to the similar thread discussed here and see if it helps: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-restrict-number-of-tags-we-are-able-to-select-in-the/td-p/202447

 

Regards,

Santosh

Translate
Santosh Sai