Copy link to clipboard
Copied
Is there a way to export a multi-line textbox into a dropdown?
Chat GPT gave me this, but it did not work
var multilineTextField = this.getField("MultilineTextField"); // Replace with the actual name of your multiline text field
var dropdownField = this.getField("YourDropdownFieldName"); // Replace with the actual name of your dropdown field
var optionsText = multilineTextField.value;
var options = optionsText.split("\n");
dropdownField.clearItems();
for (var i = 0; i < options.length; i++) {
dropdownField.addItem(options[i]);
}
Copy link to clipboard
Copied
Use this:
var multilineTextField = this.getField("MultilineTextField").valueAsString.split(/[\r\n]+/);
this.getField("YourDropdownFieldName").clearItems();
this.getField("YourDropdownFieldName").setItems(multilineTextField);
Copy link to clipboard
Copied
addItem doesn't exist in Acrobat.
Copy link to clipboard
Copied
Yea chatgpt, tried some solution, not sure if the above is possible tho
Copy link to clipboard
Copied
Use this:
var multilineTextField = this.getField("MultilineTextField").valueAsString.split(/[\r\n]+/);
this.getField("YourDropdownFieldName").clearItems();
this.getField("YourDropdownFieldName").setItems(multilineTextField);