show/hide /print element on multiple master pages








Hi again,

I'm continuing to have a problem with something that should be simple but I can't figure out.

I have a large form.

On one of the pages there's a button that says 'is there a non disclosure order in place' - radio button with yes/no.

If the user selects 'yes' I want the words 'non disclosure' to appear on all my pages.

I've gone about this by creating a text field (non editable) on each master page. It's down at the bottom middle and doesn't interfer with any other element. I've called each of these fields 'nonDis'

Radzmar and Josh Geurian have been brilliant in helping me but I'm still not quite getting it.

Back to the page that the radio buttons are on...

On the click scripting event I have this code:

var mp = xfa.resolveNodes("#pageSet.CoreMaster[*].nonDis");

var mp2 = xfa.resolveNodes("#pageSet.COREMASTER2[*].nonDis");

var mp3 = xfa.resolveNodes("#pageSet.INFORMATIONSHARING[*].nonDis");

var mp4 = xfa.resolveNodes("#pageSet.CHRONOLOGY[*].nonDis");

var mp5 = xfa.resolveNodes("#pageSet.NATPRACTICEMODEL[*].nonDis");

var mp6 = xfa.resolveNodes("#pageSet.ASSESSMENT[*].nonDis");

var mp7 = xfa.resolveNodes("#pageSet.PLAN[*].nonDis");

var mp8 = xfa.resolveNodes("#pageSet.REVIEW[*].nonDis");

var mp9 = xfa.resolveNodes("#pageSet.PLAN2[*].nonDis");

var mp10 = xfa.resolveNodes("#pageSet.SUMMARYESSENTIALINFO[*].nonDis");

var mp11 = xfa.resolveNodes("#pageSet.OPEN[*].nonDis");

for (var i = 0; i < mp10.length; i += 1) {

     mp10.item(i).presence = this.rawValue != "No" ? "visible" : "hidden";


for (var i = 0; i < mp11.length; i += 1) {

     mp11.item(i).presence = this.rawValue != "No" ? "visible" : "hidden";


for (var i = 0; i < mp.length; i += 1) {

     mp.item(i).presence = this.rawValue != "No" ? "visible" : "hidden";


for (var i = 0; i < mp2.length; i += 1) {

     mp2.item(i).presence = this.rawValue != "No" ? "visible" : "hidden";


for (var i = 0; i < mp3.length; i += 1) {

     mp3.item(i).presence = this.rawValue != "No" ? "visible" : "hidden";


for (var i = 0; i < mp4.length; i += 1) {

     mp4.item(i).presence = this.rawValue != "No" ? "visible" : "hidden";


for (var i = 0; i < mp5.length; i += 1) {

     mp5.item(i).presence = this.rawValue != "No" ? "visible" : "hidden";


for (var i = 0; i < mp6.length; i += 1) {

     mp6.item(i).presence = this.rawValue != "No" ? "visible" : "hidden";


for (var i = 0; i < mp7.length; i += 1) {

     mp7.item(i).presence = this.rawValue != "No" ? "visible" : "hidden";


for (var i = 0; i < mp8.length; i += 1) {

     mp8.item(i).presence = this.rawValue != "No" ? "visible" : "hidden";


for (var i = 0; i < mp9.length; i += 1) {

     mp9.item(i).presence = this.rawValue != "No" ? "visible" : "hidden";


I've referenced each of the nonDis text fields individually but only the fileds in the master pages: CoreMaster, COREMASTER2, SUMMARYESSENTIALINFO and OPEN work. Despite their ordering in the code they happen to be the first four master pages that are used in order in the document. The actual order is: OPEN, SUMMARYESSENTIALINFO, CoreMaster, COREMASTER2 - these are then followed by INFORMATIONSHARING and contine down the list in order.

I should mention that each nonDis field appears on the top level of each of the master pages (ie. not in a sub form). I have a feeling it's something perhaps to do with my above code maybe not being succint enough - or there being a better way to write it. It could also perhaps be something to do with the transition between the last page that does work (using COREMASTER2 masterpage) to the first one that doesn't (using INFORMATIONSHARING master page).

There is also another big issue in that as soon as I click the print button all the nonDis fields revert back to their opening state of invisible and they stay that way despite the radio button remaining selected on 'Yes' - if i toggle yes/no they reappear on screen, but again disappear when printing. I can't let this happen as the form is meant to be printed.


So please help... this is (I think) the last piece of the puzzle in a project that has taken months. If there's anything else I can provide you with to help please just ask.

View Entire Topic








Hi Radzmar,

Tried running it in acrobat reader and pro - no joy. Also placed it in the exit event but still no joy. I can just about uderstand what your code is trying to do - though it's beyond my expertise - just not sure why it's not making any changes. I've even got the various versions of nonDis occuring in different states when first opened (hidden, visible, invisible etc.) but nothing seems to be making a difference.

The next thing I am going to try to do is use a completely blank form and see if I can get it to work with this and methodically check from there.

Will keep you posted.