Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Clear form with reset button & clear fields

Explorer ,
Oct 01, 2024 Oct 01, 2024

I have a form in Acrobat pro that when the checkboxes are engaged, it populates text elsewhere in my document. I created a reset button that will clear the checkboxes, but it does not also undo the text where it is programmed to appear. However, if I manually uncheck the box, it does unpopulate in the designated area assigned. Can the Reset button do this so I do not have to check then uncheck the checkbox manually?

TOPICS
Create PDFs , How to , Modern Acrobat , PDF , PDF forms
1.3K
Translate
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
1 ACCEPTED SOLUTION
Community Expert ,
Oct 01, 2024 Oct 01, 2024

Your reset button would also have to reset field "5".  I assume the script is a Mouse Up action.  It only runs when the check box is clicked, not when it is reset.  Alternatively you can populate the text field using a custom calculation script in the text field instead:

var cText=".Text is placed here that populates elsewhere."'

this.getField("CheckBox").value=="Off"?event.value="":event.value=cText;

The difference is you won't be able to change the text field value because it will always revert to the calculated value.  It will display "" when the text field is reset, however.  These articles might help you:

https://pdfautomationstation.substack.com/p/pdf-form-reset-tricks

https://pdfautomationstation.substack.com/p/calculation-vs-validation-scripts

https://pdfautomationstation.substack.com/p/calculation-vs-validation-scripts-eb5

 

View solution in original post

Translate
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 Expert ,
Oct 01, 2024 Oct 01, 2024

It should. How did you set up the reset button, though? What action does it perform?

Translate
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
Explorer ,
Oct 01, 2024 Oct 01, 2024

Thank you for your help!

I set up a Mouse up as the trigger and Reset a form as the action. 

Next, I indicated the checkbox names it applies to then saved. 

The action perfoms correctly, but if I reset the selections using the button, it does not unselect the items that are populating elsewhere within my document. 

Translate
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 Expert ,
Oct 01, 2024 Oct 01, 2024

Did you rename any fields after selecting them for the Reset command?

Can you share the file?

Translate
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 Expert ,
Oct 01, 2024 Oct 01, 2024

"I indicated the checkbox names it applies to".  Did you also select the other fields that were populated by the check boxes?  If not they are not going to clear because your check box population script is a mouse up action.  It only works when the mouse is used to trigger the checkbox, not when the check box field is reset.

Translate
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 Expert ,
Oct 01, 2024 Oct 01, 2024

Can you provide an example of the script that populates text for one of the check boxes and where the script is located?

Translate
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
Explorer ,
Oct 01, 2024 Oct 01, 2024

Thank you so much for your assistance. I have uploaded where the checkboxes are located and where they populate. Please let me know if the screenshots make sense. 

 

I have the following script on each checkbox:

var cText = "• Text is placed here that populates elsewhere.";

this.getField("5").value = (event.target.value == "Off")? "" : cText;

Translate
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 Expert ,
Oct 01, 2024 Oct 01, 2024

Your reset button would also have to reset field "5".  I assume the script is a Mouse Up action.  It only runs when the check box is clicked, not when it is reset.  Alternatively you can populate the text field using a custom calculation script in the text field instead:

var cText=".Text is placed here that populates elsewhere."'

this.getField("CheckBox").value=="Off"?event.value="":event.value=cText;

The difference is you won't be able to change the text field value because it will always revert to the calculated value.  It will display "" when the text field is reset, however.  These articles might help you:

https://pdfautomationstation.substack.com/p/pdf-form-reset-tricks

https://pdfautomationstation.substack.com/p/calculation-vs-validation-scripts

https://pdfautomationstation.substack.com/p/calculation-vs-validation-scripts-eb5

 

Translate
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
Explorer ,
Oct 01, 2024 Oct 01, 2024

Yasssss it worked perfectly. 

 

Why in hindsight does it all make sense? Because of course! I chose to keep with the mouse up action but I thank you for including both options. 

 

Thank you so much!

Translate
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
Explorer ,
Oct 01, 2024 Oct 01, 2024
LATEST

Sometimes the wording "custom calculation script" sends me! I will buck up better.

Translate
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