Copy link to clipboard
Copied
Hi everybody, is it possible to clear the fields of a form when I open a PDF document? How? Is it possible in Adobe Javascript?
Regards
Copy link to clipboard
Copied
3.01 |
Resets the field values within a document. Resetting a field causes it to take on its default value (which, in the case of text fields, is usually blank).
Note:If the form contains signature fields, signature rights https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/Acro12_MasterBook/JS_API_AcroJSPre...are required to use the method in Adobe Reader.
aFields | (optional) An array specifying the fields to reset. If not present or null, all fields in the form are reset. You can include non-terminal fields in the array. |
Select fields to be reset and reset them.
var fields = new Array();
fields[0] = "P1.OrderForm.Description";
fields[1] = "P1.OrderForm.Qty";
this.resetForm(fields);
The same fields can be reset using only one line of code:
this.resetForm(["P1.OrderForm.Description","P1.OrderForm.Qty"]);
This example shows how to reset a whole subtree. For example, if you pass “name” as part of the fields array, all name fields, such as name.first and name.last, are reset.
this.resetForm(["name"]);
Copy link to clipboard
Copied
Thanks, at Document level, below works if you are just wanting to reset one form field on open. Omitting the subtree brackets [ ]
this.resetForm("fieldname");
Copy link to clipboard
Copied
Yes, it's possible to do that with a simple script, but you can't apply such a script with the free Reader. Do you have Acrobat? If so, which version?
Copy link to clipboard
Copied
Juanki wrote
is it possible to clear the fields of a form when I open a PDF document?
Hi Juan,
You don't need to write JavaScript, but you do need Acrobat, not the free Reader. Set a Page Property for Page 1 (or whatever page the PDF opens to) in either the Page Thumbnails panel or Organize Pages.
Trigger: Page Open
Action: Reset a form
~ Jane
Here are the plans and pricing. If you don't want the annual plan, paid monthly, you can get a monthly plan for $25. There is also a seven-day free trial.
Copy link to clipboard
Copied
That will reset the form each time you open page 1, not just when you open the file, though... For example, if you fill in some data, scroll to page 2 and then back to page 1, that data will be gone.
Copy link to clipboard
Copied
Hi, I agree with the @try67 , it resets the form every time I move between pages. What is the best way to clear the form. Thank You
Copy link to clipboard
Copied
Reset the form at document open.
Copy link to clipboard
Copied
It works jane-e!!
Thanks and regards
Copy link to clipboard
Copied