Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
It should. How did you set up the reset button, though? What action does it perform?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Did you rename any fields after selecting them for the Reset command?
Can you share the file?
Copy link to clipboard
Copied
"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.
Copy link to clipboard
Copied
Can you provide an example of the script that populates text for one of the check boxes and where the script is located?
Copy link to clipboard
Copied
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;
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
Sometimes the wording "custom calculation script" sends me! I will buck up better.

