Problem: I’m trying to populate a dropdown using JavaScript, but the items aren’t appearing. The script detects the dropdown and displays messages in an errorBox, but when attempting to add items with addItem(), nothing happens.
Has anyone successfully added items to a dropdown dynamically? Are there any known limitations or workarounds?
Here’s a simplified version of my code:
var dropdown = prez.object(“drpTags”);
var errorBox = prez.object(“errorBox”);if (dropdown) {
errorBox.text(“drpTags found! Attempting to add test items…”);dropdown.clearItems(); dropdown.addItem("one"); dropdown.addItem("two"); dropdown.addItem("three"); errorBox.text("Test items added successfully!");
} else {
errorBox.text(“ERROR: drpTags NOT found!”);
}
Any advice or alternative approaches would be greatly appreciated!
ActivePresenter version: AP9
OS: Win11Preformatted text
Notes: