Copy link to clipboard
Copied
I found this script in the forums and I was playing around with it and discovered it would hide all the fields but would not make them visible when I made the changes to visible. Here's the script:
var nButton = app.alert({
cMsg: "Do you want to hide fields?",
cTitle: "Make Read-Only?",
nIcon: 2, nType: 2
});
if (nButton == 4) {
for (var i = 0; i < this.numFields; i++) {
var fname = this.getNthFieldName(i);
this.getField(fname).hidden = true; // makes all fields readonly
}
}
this.getField("ButtonA").readonly = false;
this.getField("ButtonA").display = display.visible;
This script works to hide all fields but when I change "hidden" to "visible", and click the button, the fields remain hidden. I'd like to use something like this to hide/show the fields instead of using something like this to hide/show,
this.getField("FieldA").display = display.hidden;
this.getField("FieldA").display = display.visible;
(I have lots of fields to hide/show).
Can someone please show me how I can use the script above to hide and show my fields? I have two buttons, click button A to hide, click button B to make visible. I know this script above is to make the fields Read-Only but it also works to hide the fields so I thought it could also make the fields visible with a little modifying and expertise. Can someone let me know? Thank you guys.
Copy link to clipboard
Copied
You should not be using the hidden property. It has been deprecated and replaced by the display property, which is what you're using in the rest of your code.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now