Skip to main content
Known Participant
March 15, 2018
Question

Reset form fields and go to

  • March 15, 2018
  • 2 replies
  • 1725 views

Hello,

In a PDF form I need to reset form fields via a Reset Button, and after that I need to do a go to label, because reset will clear a few fields that has been populated via a dialog display entry.  I need to go back where the dialog started to get the data again via dialog fields.  Your help and suggestion is appreciated in advance. 

Regards,

Jeff P

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
March 15, 2018

Do you mean "go to" as in "go to a line of code in a script and execute from there"? If so, that's not possible with JS, nor is it necessary. You can just call that code once more (assuming it's in a function) after resetting the fields.

Known Participant
March 15, 2018

yes, I want to go back and run the dialog code to get the data, I just don't know how I can fall back to first dialog it was displayed.

try67
Community Expert
Community Expert
March 15, 2018

Put the code that displays the dialog in a function and then call that function.

Thom Parker
Community Expert
Community Expert
March 15, 2018

use this code to put the focus on a specific field

this.getField("TheFieldName").setFocus();

Put this code in a "Run a JavaScript" action on the same button that does the reset.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Known Participant
March 15, 2018

Thanks, but did not worked out... Reset does not work... neither continue, goto, go to etc...