Search code examples
javascriptacrobat

how to hide or show a field after the form is digitally signed | Acrobat pdf forms


I have a form that needs to be digitally signed. After the form is signed, all form fields are made readonly from the properties. But my buttons are not hidden. What can I do to hide the buttons??

PS - I am using acrobat 15


Solution

  • There seems to be no in-built function or property to achieve the desired result. But I got a simple javascript that I could use to make all fields readonly and hide all buttons both at the same time.

    for ( var i = 0; i < this.numFields; i++) {
        var fname = this.getNthFieldName(i);
        if(fname.type == "button")
        {
            this.getField(fname).display = display.hidden;
        }
        else if ( fname != "Signature_2" ) 
               this.getField(fname).readonly = true ; 
    }