Expand my Community achievements bar.

Adobe Summit 2025: AEM Session Recordings Are Live! Missed a session or want to revisit your favorites? Watch the latest recordings now.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

Restrict tag field to max 2 tags TouchUI

Avatar

Level 4

I have a dialog field of following resource type 

sling:resourceType="cq/gui/components/coral/common/form/tagfield".

 

I would like to allow authors to select maximum of two tags. How to achieve this ? 

4 Replies

Avatar

Community Advisor

Hi @vjleo94 

 

This blogpost might help. Have not tried this out myself.

 

http://experience-aem.blogspot.com/2016/06/aem-62-touch-ui-validator-for-restricting-tag-count-dialo...

 

Thanks,

Avatar

Level 4

@JeevanRaj I saw this as well. But this is being done on a tagpicker. Not on a "cq/gui/components/coral/common/form/tagfield"

Avatar

Community Advisor

We can implement custom validators.

Please check below example for validators.

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

 

Avatar

Level 4

Thanks @Mani_kumar_ , I will try it out!