Copy link to clipboard
Copied
I am creating a form that has several signature fields for several different people to approve the document. Not all signatures may be required, so I am creating buttons where the user clicks the button and the unneeded signature fields 'hide'. Is there a way to undo that action if the user decides the signature field they 'deleted' is now needed? The undo option under 'Edit' doesn't work. It seems that once the button has been clicked the action is performed and it's done and there is no undoing. Does anyone know if an 'undo' option with buttons is available?
Copy link to clipboard
Copied
Here's a simple example of a script to toggle the visibility of a field:
var f = this.getField("Name of field goes here");
f.display = (f.display==display.visible) ? display.hidden : display.visible;
Copy link to clipboard
Copied
Add a button which performs the undo.
Copy link to clipboard
Copied
You can use the same button to show/hide the fields, but that will require using a script.
The built-in Undo command will not work, I think.
Copy link to clipboard
Copied
try67 would you happen to know what the script is or where I can find it? Thanks!
Copy link to clipboard
Copied
Here's a simple example of a script to toggle the visibility of a field:
var f = this.getField("Name of field goes here");
f.display = (f.display==display.visible) ? display.hidden : display.visible;
Copy link to clipboard
Copied
If I have more than field how do I do that as far as the script? Are the names separated by commas?
Copy link to clipboard
Copied
Not quite. You can use this code to do it:
var fields = ["Field1", "Field2", "Field3"];
for (var i in fields) {
var f = this.getField(fields);
f.display = (f.display==display.visible) ? display.hidden : display.visible;
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now