AcroForm: Add support for ResetForm action

- it aims to fix #12721.
  - Thanks to PR #14023, we've now the fieldObjects in the annotation layer so we can easily map fields names on their id if needed.
  - Reset values in the storage, in the JS sandbox and in the visible html elements.
This commit is contained in:
Calixte Denizet 2021-09-26 21:04:11 +02:00
parent db7c91e7b1
commit aecbd7cd89
7 changed files with 302 additions and 15 deletions

View file

@ -476,6 +476,10 @@ class Field extends PDFObject {
return false;
}
_reset() {
this.value = this.valueAsString = this.defaultValue;
}
_runActions(event) {
const eventName = event.name;
if (!this._actions.has(eventName)) {