Reset button not working properly | Community
Skip to main content
New Participant
February 28, 2022
Solved

Reset button not working properly

  • February 28, 2022
  • 2 replies
  • 958 views

Good day,

 

I have to click the reset button on my form several times in order to clear the whole document. Example: When I first click the button, the first box is cleared, then when I click it again, the second block is cleared, click again 3 blocks are cleared, etc....

The script in the click event of the button is "xfa.host.resetData();"

 

Please help! 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by radzmar

Hi,

 

there's another way to reset a form, which works better than resetData().

Given the root node of you form is named "form1" than it looks this way.

xfa.datasets.data.loadXML("<form1/>", true, true);
xfa.form.remerge();

 

2 replies

radzmar
radzmarAccepted solution
New Participant
March 1, 2022

Hi,

 

there's another way to reset a form, which works better than resetData().

Given the root node of you form is named "form1" than it looks this way.

xfa.datasets.data.loadXML("<form1/>", true, true);
xfa.form.remerge();

 

Mayank_Tiwari
Employee
February 28, 2022

You should use the OOTB reset button object to clear the form fields.

Please refer to the following sample form for reference:

 

https://drive.google.com/file/d/116z66FnFNZt-ExRyHvywyb5t9Oxdd61R/view?usp=sharing