Expand my Community achievements bar.

Howt to reset subform, not the whole page

Avatar

Former Community Member
Im trying to add a "reset" button to reset just certain page of the whole document. The "reset" button in Adobe actually resets the whole thing. Is there a way to just reset certain page?

I found this on one of the threads: xfa.host.resetData(Top of Next Page.Page1); but it didn't work for me?

Any help is appreciated.

Thanks much.
2 Replies

Avatar

Level 5
To my knowledge reset part of the form is not an option at this time in Adobe forms designed in LC. Here is trick you can play. For each of the object/field you have visible get a hidden field and save the value of each of those fields in hidden field at docOpen/FormLoad event. Then repopulate from the hidden field when user wants to reset data for that section. It would be as efficient as you can write code in JavaScript.



Good Luck,

SekharN

Avatar

Level 7
In LiveCycle Designer you can use the "$host.resetData()" method. It has an optional list (separated by commas) of the names of all fields to reset. If not present or empty, all the fields in the form are reset to their default value. So one could build a list of form field names or use FormCalc to compute them.



From the "LiveCycle Designer Scripting Basics" ( http://www.adobe.com/devnet/livecycle/articles/lc_designer_scripting_basics.html ):



"To reset the default values add a click event to the Clear button. You need a dynamic reference syntax expression because the detail is a repeating subform and must be reflected in the reference syntax expression. In this situation, it is easier to build the resetData parameters separately."



var f1 = this.parent.somExpression + ".TextField2" + ",";

var f2 = f1 + this.parent.somExpression + ".DropDownList1" + ",";

var f3 = f2 + this.parent.somExpression + ".NumericField1";

// ...and pass the variable as a parameter.

xfa.host.resetData(f3);