


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) {
xfa.host.resetData();
xfa.form.remerge();
}
form1.page1.employeeInfo.Section1._KeyObjectives_Sub.setInstances(1);
Views
Replies
Sign in to like this content
Total Likes
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.
Views
Replies
Sign in to like this content
Total Likes
Thank you for your help.
Works perfect!
Thank you
Views
Replies
Sign in to like this content
Total Likes