Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Reset button not working properly

Avatar

Level 5

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! 

1 Accepted Solution

Avatar

Correct answer by
Level 10

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();

 

View solution in original post

2 Replies

Avatar

Employee

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

 

Avatar

Correct answer by
Level 10

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();