Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Reset button not working properly

Avatar

Level 6

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