Skip to main content
Known Participant
Mar 15, 2018 4:47 PM UTC
Question

Reset form fields and go to

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 is closed to new replies. Start a new post to keep the conversation going.

15 replies

try67
Community Expert
Community Expert
Mar 15, 2018 5:49 PM UTC

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.

Translate
Known Participant
Mar 15, 2018 7:02 PM UTC

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.

Translate
try67
Community Expert
Community Expert
Mar 15, 2018 8:00 PM UTC

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

Translate
Thom Parker
Community Expert
Community Expert
Mar 15, 2018 5:09 PM UTC

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.

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Known Participant
Mar 15, 2018 7:00 PM UTC

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

Translate