I'm new at this and I'm currently working on a document in Acrobat Pro DC where I want to have a portion of the document hidden until all of the required fields are filled with any value.
So far, I've only found resources on how to use a check box (or something similar like a button) to hide/show the additional portion of the document. This is what I'll end up doing as a last resort, but it's not ideal since the user will be able to toggle it on/off at any time, and my preference is for them to be able to do so only after all the fields are filled out.
Copy link to clipboard
The state of the"required" fields can be detected with a calculation script. Calculation scripts are run any time any field on the form is changed. I'm not sure what you mean by "required", so for the example code I'll use a list of field names.
Put this code in to a calculation script in any field on the form that is not already doing a calculation. You could even create a hidden field for this purpose.
var aFields = ["Field1", "Field2", "Field3", ...etc...];
var bAllFilled = true;
var oFld = this.getField(aFields);
if(oFld.value == oFld.defaultValue)
bAllFilled = false;
... Code for showing other part of form ...