Let me try to explain the problem in details. I am using Acrobat 2017 and before saving an interactive form, I have to check whether the sum of two field values is equal to a predefined constant value.
If the sum of the two field values is not equal to the desired constant value, I send an alert message, then clear the two field values to force the user entering new valid values.
The problem I noticed occurs with the distributed version of the form (typically the type of form that the users will receive). When I test entering two wrong field values, I see the alert message, then the two field values are cleared on screen, as expected. However, if I close the form (without manually saving it) and reopen it, I see the two wrong field values that have been previously saved in the form.
I am concern about those incorrect values being saved and compiled when I will track and collect the interactive forms returned by the users.
Actually, I noticed two different behaviors when I tested my code using the same sequence of actions.
When I am testing directly from my interactive PDF file in Preview mode, if I enter two wrong values (whose sum is not equal to the desired constant number), then try to save the file, I receive the alert message, the field values are cleared. If I close the PDF file right after without saving a second time, then reopen it, the previous wrong field values are not there anymore (they are really cleared).
However, if I try to reproduce EXACTLY that same sequence of actions from the PDF file generated by the Distribute button, then at the last step, the wrong field values will reappear when reopening the PDF file, even though I have seen them cleared previously on the screen when saving before closing the file.
The document action code I added is triggered through the event "The document will be saved."
Is it normal that the original PDF form in Preview mode and the distributed PDF form do not beahve the same?