Expand my Community achievements bar.

Set Instances back to default


Level 7

What wrong with the script below on click event?

Reset data but does not reset the instances back to one.

when there are more than one instances which is the default.

Thank you


var cResponse = app.alert({

    cMsg: "Do you really want to reset the form?\rAll data will be lost!",

    nIcon: 2, nType: 2, 

    cTitle: "Reset Form"});

// clear form only if response is "OK"

if (cResponse == 4) {







2 Replies


Level 6

resetData() - only resets the data entered/updated on the fields to default values.

The above code works fine with the a small change in steps sequence.

call "form1.page1.employeeInfo.Section1._KeyObjectives_Sub.setInstances(1);" code before "xfa.form.remerge();" line. After remerge(), unable to get the the subform it self, so it never executes "setInstances" method, you can check this by placing try/catch block with the existing code.

For more details and another way of doing the same functionality, check the thread here: http://forums.adobe.com/thread/836420

Hope this helps.


Level 7

Thank you for your help.

Works perfect!

Thank you

page footer