I have PDF with a dropdown field called "SoftwareList" with a default value of "Select Software" and a text field called "SelectedSoftware". You can freely type in the text field to communicate your needs, or choose for the dropdown. I am looking to add to the text field what is selected in the dropdown each time. I had the following script accomplishing this as a custom calculation script on the text field:
if (this.getField("SoftwareList").value != "Select Software")
this.getField("SelectedSoftware").value += this.getField("SoftwareList").value + ", "
The problem I have is that it will continue to add to the text field with whatever was chosen last in the dropdown when other fields in the form, such as check boxes, are clicked. I tried placing this on different actions as well at the keystroke in the properties format tab but didn't work there. I added the following line, which has helped however there is still one addition click before it changes, duplicating the last choose:
this.getField("SoftwareList").value = "Select Software"
Appreciate any help with this.
I would use the custom validation script of the drop-down. You can use something like this:
if (event.value!="Select Software") this.getField("SelectedSoftware").value += event.value + ", ";
To make sure it updates as soon as a selection is made tick the option to commit the selected value immediately under the drop-down's Properties, Options tab.
Worked. Thanks a bunch!