Restrict tag field to max 2 tags TouchUI | Community
Skip to main content
vjleo94
Level 3
February 8, 2022

Restrict tag field to max 2 tags TouchUI

  • February 8, 2022
  • 2 replies
  • 1710 views

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 ? 

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

2 replies

JeevanRaj
Community Advisor
Community Advisor
February 8, 2022
vjleo94
vjleo94Author
Level 3
February 8, 2022

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

Mani_kumar_
Community Advisor
Community Advisor
February 8, 2022

We can implement custom validators.

Please check below example for validators.

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

 

vjleo94
vjleo94Author
Level 3
February 9, 2022

Thanks @mani_kumar_ , I will try it out!