Last active
March 9, 2020 14:48
-
-
Save bjoerntx/9d45884910734ea906daf709433908c6 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 addComboFormField() { | |
TXTextControl.formFields.getCanAdd(canAdd => { | |
if (canAdd) { | |
// Add form field | |
TXTextControl.formFields.addSelectionFormField(emptyWidth, ff => { | |
var cars = ["Porsche", "BMW", "Dodge", "Mercedes", "Ford"]; | |
ff.setItems(cars); | |
ff.setSelectedIndex(4); | |
highlight(ff); | |
}); | |
} else { | |
console.log("Cannot add field at that location."); | |
} | |
}); | |
} | |
function highlight(formField) { | |
var highlightColor = "rgba(9, 165, 2, 0.3)"; | |
var highlightMode = TXTextControl.HighlightMode.Always; | |
formField.setHighlightColor(highlightColor); | |
formField.setHighlightMode(highlightMode); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment