Limit number of selection in Dropdown AEM 6.5

rajeshk7403909

03-02-2020

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,

Accepted Solutions (1)

Accepted Solutions (1)

Vijayalakshmi_S

MVP

04-02-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)

Answers (0)