I am creating a smartform which consist of 2 "pages", Affiliatepage and AVNPage, with a lot of hidden fields.
I am trying to add a button on each page that remerge only that page ( so only Affiliatepage or AVNPage).
I succeeded in adding buttons that clears the data,
but I also need buttons that remerge the whole page. I tried many types of scripting but none seem to work. I tried adding the name of the object between the brackets but that does not work.
Can anyone help me with this?
When creating a script object in LiveCycle for a PDF form, the script object is empty at first, so you must build it by inserting functions within that script object.
So if you look inside the objReset script object in my form, you can see that there is code in there, by copying the content of the script object and pasting it in the script object you created in your form, you will be able to access the objReset.getFields() function.
Make sure that the script object you have created in your PDF form has the name objReset!
Hope this help!
hmm no I did not.
As I said I have no JS knowledge so please go easy on me
From studying your form and specifically the "Reset all but Specific Fields"- button, it seems i need to add a script object in my form on the form level and name it "objReset" (seems easy enough) but I am not sure what you mean with : "inserted the function accordingly in the object as well?"
Hope you have the patience to help me out
unfortunately, I doubt xfa.form.remerge can remerge part of the form only..
If you use the functions I provided in my form, the script object objReset contains functions to retrieve all objects withing a part of the form. you can call only the function xfa.host.reset with a function within that script object to have your form remerged.. use the functionality with the following :
Ah, my Livecycle was set to only show events with scripts. Switched to All Events so now I see the scripting.
I copied all of it and added it to the objReset i created in my form:
The code for the actual button now looks like this:
The data now is removed from the fields that contained data, but the the hidden fields that became visible are not made hidden again.
However if I apply this script and test run it, nothing happens, or to be more precise, it counts as a regular mouseclick.
I am no scriptingwizard so maybe I am interpreting your solution incorrectly?
I checked the post and your PDF, but am not sure how to proceed.
I expected a remerge to be what I was looking for to completely reset only 1 of the 2 pages, as below for instance the object called "Affiliatepage".
I expected the scripting visible below to to just that but it does not.
What am I doing wrong?
I've made up a discussion with an example form that resets parts of forms,
it also includes the option to remerge the whole form.
The function reset I created in this example resets back all objects back to their initial visibility.
If this can help you take a look at it, any feedback is also welcome!
I don't think the remerge option is what you are looking for, you might want to remove that option for your needs.
Hope it will help!