Skip to main content
Participant
July 2, 2019
Answered

Is there a way to undo an action once a button has been clicked?

  • July 2, 2019
  • 2 replies
  • 1547 views

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?

This topic has been closed for replies.
Correct answer try67

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;

2 replies

try67
Community Expert
Community Expert
July 2, 2019

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.

Participant
July 2, 2019

try67 would you happen to know what the script is or where I can find it? Thanks!

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
July 2, 2019

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;

Bernd Alheit
Community Expert
Community Expert
July 2, 2019

Add a button which performs the undo.