Copy link to clipboard
Copied
Using Adobe Acrobat Pro, I have created a text field that is populated from a a dropdown selection using a simple script (The script is below).
It works great. However, I need to have the text field editable also. Currently, any edits made to the text field revert back to the original text that is populated from the dropdown selection.
Is it possible to have the text field populated based on the dropdown selection and also be editable?
Thanks for any insight.
Sample of script used and working
var v = this.getField("Dropdown1").value;
if (v=="Selection1") event.value = "Long description for Selection1";
else if (v=="Selection2") event.value = "Long description for Selection2";
else if (v=="Selection3") event.value = "Long description for Selection3";
else event.value = "";
Copy link to clipboard
Copied
Yeah, there are a couple of ways of doing it. One would be to move the script to be the validation script of the drop-down, instead of the calculation of the text field. You will need to adjust it a bit, though, like this:
var v = event.value;
var f = this.getField("Text1");
if (v=="Selection1") f.value = "Long description for Selection1";
else if (v=="Selection2") f.value = "Long description for Selection2";
else if (v=="Selection3") f.value = "Long description for Selection3";
That way the text field will only be updated when you change the drop-down and you'll be able to edit it manually, if you wished to.
Copy link to clipboard
Copied
Yeah, there are a couple of ways of doing it. One would be to move the script to be the validation script of the drop-down, instead of the calculation of the text field. You will need to adjust it a bit, though, like this:
var v = event.value;
var f = this.getField("Text1");
if (v=="Selection1") f.value = "Long description for Selection1";
else if (v=="Selection2") f.value = "Long description for Selection2";
else if (v=="Selection3") f.value = "Long description for Selection3";
That way the text field will only be updated when you change the drop-down and you'll be able to edit it manually, if you wished to.
Copy link to clipboard
Copied
Thanks, I'll give it a try.

