Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

change "choiseListe" values with javascript

Avatar

Level 3

Dear,

Is it possible to change "choiseListe"  values  with javascript.

Exemple il have a choseListe :

     Country //// Values

      USA            us

      France         fr

      Spain           sp

When il click in a botton i whant to change this choceListe :

     Country //// Values

      Morocco           ma

     Portugal           pt

............

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

Listboxes and dropdowns can be scripted against without too much difficulty.

You would need something like this in the click event of the button:

listbox1.rawValue = null; //clear previous choice

listbox1.clearItems(); //clear the list items

listbox1.addItem("Moocco", "ma"); //add new list items

listbox1.additem("Portugal", "pt");

Hope that helps,

Niall

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi,

Listboxes and dropdowns can be scripted against without too much difficulty.

You would need something like this in the click event of the button:

listbox1.rawValue = null; //clear previous choice

listbox1.clearItems(); //clear the list items

listbox1.addItem("Moocco", "ma"); //add new list items

listbox1.additem("Portugal", "pt");

Hope that helps,

Niall