Reset button a la cart

Community Beginner ,
Oct 30, 2019 Oct 30, 2019

Copy link to clipboard

Copied

I have a reset button to reset specific fields, but is there a javascript to allow the user to choose themselves which field they want to reset? rather choosing the fields for them. I'm using adobe pro

 

Thank you so much! 

TOPICS
Acrobat SDK and JavaScript, PDF forms

Views

203

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Oct 30, 2019 Oct 30, 2019

Copy link to clipboard

Copied

Hi

Adobe does not make an application called Adobe Pro, but it sounds like you are creating fields in Adobe Acrobat. I’ll move this from the “Get Started” forum for you.

~ Jane

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 30, 2019 Oct 30, 2019

Copy link to clipboard

Copied

sorry for being a noob, thank you! 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Oct 30, 2019 Oct 30, 2019

Copy link to clipboard

Copied

No worries, that’s what we’re here for!

 

I don’t write JavaScript and I am away from my office right now, but I wonder if an action can be written with pause on the options  so the fields cans be chosen by the user. I can test it tomorrow.

 

~ Jane

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Oct 31, 2019 Oct 31, 2019

Copy link to clipboard

Copied

LATEST

An Action won't work as a reset button on a form.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Oct 31, 2019 Oct 31, 2019

Copy link to clipboard

Copied

So, there are a couple of different approaches to doing this. The easiest is to present the user with a menu of fields to be reset. This allows the user to select a single field to be reset. 

 

If you want the user to select a group of fields it gets more complicated because you need a user interface for selecting the fields. If this form is to be used by other users, then the suggestion of using an Action won't work. The code for the reset has to be on the form.

 

One approach is to use a multiselect list field on the form itself. This list field could be initially invisible, when the user presses the reset button it becomes visible, as well as a done button. This is tricky because you want the user's focus on the relevant fields. So maybe the reset of the form could be covered with translucent gray rectangles. 

Here are some articles on using lists:

https://acrobatusers.com/tutorials/list_and_combo_in_lc

https://www.pdfscripting.com/public/List-Field-Usage-and-Handling.cfm

 

As complicated as this approach sounds, the next solution is somewhat simpler, but requires more advanced scripting. Which is to use a popup custom dialog for the selection. You'll find info on custom dialogs here. 

https://www.pdfscripting.com/public/ACRODIALOGS-OVERVIEW.cfm

https://www.pdfscripting.com/public/Alerts-Popups-and-Other-UI.cfm#JSCustomDlg

https://acrobatusers.com/tutorials/popup_windows_part5

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines