Copy link to clipboard
Copied
Hi! I don't have any experience with script, I need to create a custom script in my Adobe Acrobat form.
I have created a dropdown list with insurance names.+ I have created a text field for each of them. In want in order for the form to be able to automatically associated text fields, they should be visible on the form when a selection is made from the drop-down list, while all others will be hidden.
I need help, thanks in advance.
Copy link to clipboard
Copied
You need to ask program questions in the forum for the program you are using
To ask in the forum for your program please start at https://community.adobe.com/
Moving from Using the Community (which is about the forums) to the Acrobat forum
Copy link to clipboard
Copied
The basic code is something like this (as the drop-down field's custom Validation script):
if (event.value=="Company1") {
this.getField("Text1").display = display.visible;
this.getField("Text2").display = display.visible;
} else {
this.getField("Text1").display = display.hidden;
this.getField("Text2").display = display.hidden;
this.resetForm(["Text1", "Text2"]);
}
if (event.value=="Company2") {
this.getField("Text3").display = display.visible;
this.getField("Text4").display = display.visible;
} else {
this.getField("Text3").display = display.hidden;
this.getField("Text4").display = display.hidden;
this.resetForm(["Text3", "Text4"]);
}