Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Limit number of selection in Dropdown AEM 6.5

rajeshk7403909
Level 2
Level 2

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,

1 Accepted Solution
Vijayalakshmi_S
Correct answer by
Community Advisor
Community Advisor

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)

View solution in original post

1 Reply
Vijayalakshmi_S
Correct answer by
Community Advisor
Community Advisor

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)

View solution in original post