Limit number of selection in Dropdown AEM 6.5 | Community
Skip to main content
Level 2
February 4, 2020
Solved

Limit number of selection in Dropdown AEM 6.5

  • February 4, 2020
  • 1 reply
  • 2129 views

Hi There,

 

 I am currently working on dropdown/Select in AEM 6.5, I want to  limit the number of selected options , the user must only select certain maximum number of options say 2 or 3  options and  the field must be disabled unless they remove the previously selected option.

 

Thanks,

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 Vijayalakshmi_S

HI,

 

  • This can be done by associating "validation" property to the desired dialog field and include desired logic in JS targeting the respective "validation" property. (Need not exactly be "validation" property, it can be granite:class or granite:id. Idea is to have an identifier for the respective dialog field and write logic targeting the same.)
  • Field Limit can be configured at dialog field level via "granite:data" node. (Will be available as data attribute on the field and the values authored can be compared against the allowed limit)

1 reply

Vijayalakshmi_S
Vijayalakshmi_SAccepted solution
Level 10
February 4, 2020

HI,

 

  • This can be done by associating "validation" property to the desired dialog field and include desired logic in JS targeting the respective "validation" property. (Need not exactly be "validation" property, it can be granite:class or granite:id. Idea is to have an identifier for the respective dialog field and write logic targeting the same.)
  • Field Limit can be configured at dialog field level via "granite:data" node. (Will be available as data attribute on the field and the values authored can be compared against the allowed limit)