Search code examples
adobeconditional-formattingacrobat

How to hide a field in Adobe Acrobat Pro DC based on another fields content


I want to hide a fields content based on whether a preceding field is empty or not. How do I do that in Adobe Acrobat Pro DC version 19.008.20081.46137


Solution

  • Where "foo" is the name of the field that may be hidden, add the following to the custom Format script of the field that may or may not have a value.

    if (event.target.value == "") {
        this.getField("foo").display = display.hidden;
    }
    else {
        this.getField("foo").display = display.visible;
    }
    

    enter image description here