Once the form is rendered with outputService.generatePDFOutput() service, the dynamic behavior of the forms will not work, i.e. button, checkbox click, etc.
resetData will reset all the form fields.
To reset data for a few fields in the form, you can create an array of fields and then pass that array to a function and set data to null for each field by traversing the array.
This will help you write less code.
Please follow this :
https://docs.mktossl.com/docs/experience-manager-65/forms/getting-started/create-first-interactive-communication/create-form-data-model0.html