show/hide /print element on multiple master pages

Avatar

Avatar

SunsV

Avatar

SunsV

SunsV

18-10-2013

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.

screenshothelp.jpg

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

Avatar

Avatar

SunsV

Avatar

SunsV

SunsV

22-10-2013

Okay guys, sorry for bumping this but I'm at a loss as what to do here - is it simply something that is too tricky or does anyone else have any ideas.

Radzmar's code in point 6 works a treat until the page number increases/decreases and then the text field disappears throughout.

I think what I'm looking for is a couple of checks that go if the page number increases run the code again AND also when sending to print check again.

Not getting this at the moment and I've been at it for several days.

Of course there may be a much better way of doing this and any suggestions would be greatly received.

Can anyone help?