Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

Clear radio button group

Avatar

Level 2

Hello,

This seems to be a common question and I have found some answers but it does not seem to be working for me.

I have a form (form1), and on page 3 (page 3) I have a table with a group of radio buttons (9 groups of 3 radio buttons). I wrapped my radio buttons in a subform which I called 'Comparison'.

I have added a button to clear the table, and only the table (all 9 groups):

I added this code to the button:

 

xfa.host.resetData("form1.page 3.Comparison");

Show: click*, language selected is javascript, run: at client

When I test it, the button clears the whole form (all pages).

What am I missing?

Thank you!

Caroline

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Caroline,

Try and declare a variable with the full SOM Expression for the container and then pass this to the resetData method. The following is on the basis that the reset button is inside the Comparison subform.

// reset information in this subform only

var f1 = this.parent.somExpression;

xfa.host.resetData(f1);

See an example here: http://assure.ly/jcHEyc.

Hope that helps,

Niall

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi Caroline,

Try and declare a variable with the full SOM Expression for the container and then pass this to the resetData method. The following is on the basis that the reset button is inside the Comparison subform.

// reset information in this subform only

var f1 = this.parent.somExpression;

xfa.host.resetData(f1);

See an example here: http://assure.ly/jcHEyc.

Hope that helps,

Niall