Skip to main content
Participating Frequently
October 30, 2023
Question

Dropdown property

  • October 30, 2023
  • 2 replies
  • 441 views

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.

 

 

 

 

 

 

 

 

    This topic has been closed for replies.

    2 replies

    try67
    Community Expert
    Community Expert
    October 30, 2023

    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"]);
    }
    John T Smith
    Community Expert
    Community Expert
    October 30, 2023

    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