Created
April 15, 2020 07:58
-
-
Save bjoerntx/afc2627f9621b992f12b4cd69243ff5a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addDropDownFormField(items) { | |
TXTextControl.formFields.getCanAdd(canAdd => { | |
if (canAdd) { | |
TXTextControl.formFields.addSelectionFormField(0, sff => { | |
// no custom text | |
sff.setEditable(false); | |
sff.setItems(items); | |
// select "Uber" | |
sff.setSelectedIndex(3); | |
}); | |
} | |
}); | |
} | |
var transportation = ["Bicycle", "Car", "Scooter", "Uber", "Cab"]; | |
addDropDownFormField(transportation); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment