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

21-10-2013

Okay, I can understand why this isn't working now, but I can't seem to change it.

As a test I put the following code based on yours) in the prePrint and the change event of the very first master page instance of nonDis:

this.presence =  form1.Core1.core2flowed.nondisclosuretable.row1.disclosure.disclosureradio.rawValue !== "No" ? "visible" : "hidden";

however, as even the very first page has content that hides when printed I still cannot see the nonDis field as visible despite the radio button being set to 'yes'

as for adding a logic to control the check box this is a bit beyond me I'm afraid.