Closed ScottHollows closed 4 years ago
Your JavaScript statements are fine, but they need an extra line for Select2 to pick up the changed value. For example:
document.getElementById("P1234_MY_ITEM").selectedIndex = 0;
$("#P1234_MY_ITEM").trigger('change');
I have verified that your solution works
Thank you
Closing
With a regular SELECT item (not Select2) it is possible to set the value of the item to the first value in the drop list
There are at least three ways to do this with a regular ApEx Select item, but none of these work with Select2
1) Javascript document.getElementById("P1234_MY_ITEM").selectedIndex = 0;
2) Javascript document.getElementById("P1234_MY_ITEM").options[0].selected = true;
3) Javascript JQuery $("P1234_MY_ITEM").get(0).selectedIndex = 0; For all of these, Ive tried with and without quotes "0" but no luck
Is there a way to do this with Select2 ?