Expand my Community achievements bar.

Show and hide pages based on inputs from multiple fields

Avatar

Level 1

I'd like to use two separate fields to show and/or hide subsequent pages that a user sees.  I was trying to do this with javascript, but can't seem to get the reference to the second field to work.  I was trying the script below:

 

if (demographics.occupation.rawValue == "Regulatory Health Information Specialist" && demographics.role.rawValue == 1) {

  form1.tech1.presence = "visible";

  form1.tech2.presence = "visible";

}

The page the fields are in is called demographics and the two fields are called occupation and role.  I can get things to show and hide fine if I just limit the script to the section that refers only to occupation, but really want to have mutliple conditions included.  BTW, i have attaching this script to the occupation field.

Any help is greatly appreciated.

As an update, I've also tried the following script with no luck.

 

if ($.boundItem(xfa.event.newText) == "Regulatory Health Information Specialist" && this.resolveNode("role").rawValue == "1") {

  this.resolveNode("tech1").presence = "visible";

  this.resolveNode("tech2").presence = "visible";

}

1 Reply

Avatar

Level 10

Hi,

There are a few things to check here, it might be quicker to host your form somewhere liek Acrobat.com and add a link to this thread, We would need to know what types of fields occupation and role are, what events you have added the code to and if they are drop down lists do they have id values.

Regards

Bruce