title: In Adobe Livecycle (possibly Javascript), how do I reference multiple pages/subpages to hide them simultaneously?
body: <p>I suppose that this ultimately can apply to objects as well as pages. At the moment though, I'm really more concerned with pages and subforms.</p>
  
  <p>I want to hide/show multiple pages based on a drop-down menu selection. I have of course searched regarding this subject. Nobody seems to be quite asking for what I'm asking, and the most closely related questions only answer for a single object rather than multiple. And I have something near 80 different pages/subforms to worry about.</p>
  
  <p>I have a dropdown menu that, depending on the selection, certain pages and subforms which were previously hidden become visible. However, I am trying to build in a certain forgiveness, so that if someone accidentally selects the wrong item on the dropdown menu and goes back to correct themselves, either (1) all of the associated pages will go back to their default state of hidden, before continuing forward and making certain selections visible, or (2) each object is manually named and told to go back to being hidden.</p>
  
  <p>The only way I've found to do this is as follows:</p>
  
  <pre><code>switch (newValue)
  {
      case "1":
          this.resolveNode("subform_1").presence = "visible";
          this.resolveNode("subform_2").presence = "hidden";
          this.resolveNode("page_3").presence = "hidden";
          break;
  
      case "2":
          this.resolveNode("subform_1").presence = "hidden";
          this.resolveNode("subform_2").presence = "visible";
          this.resolveNode("page_3").presence = "hidden";
          break;
  
      case "3":
          this.resolveNode("subform_1").presence = "hidden";
          this.resolveNode("subform_2").presence = "hidden";
          this.resolveNode("page_3").presence = "visible";
          break;
  }
  </code></pre>
  
  <p>This is tedious, time consuming, and inelegant. What I'd like to do instead is address multiple objects simultaneously. Something like:</p>
  
  <pre><code>switch (newValue)
  {
      case "1":
          this.resolveNode("subform_2", "page_3").presence = "hidden";
          this.resolveNode("sabform_1").presence = "visible";
          break;
  
      case "2":
          this.resolveNode("subform_1", "page_3").presence = "hidden";
          this.resolveNode("subform_2").presence = "visible";
          break;
  
      case "3":
          this.resolveNode("subform_1", "subform_2").presence = "hidden";
          this.resolveNode("page_3").presence="visible";
          break;
  }
  </code></pre>
  
  <p>I'm aware that this is seen as inelegant in and of itself, but given the overall design of the sheet, the naming scheme, etc, there's really no way to have the system call all pages or subforms starting with the same letters and such. So I'd have to name each one individually. And that's fine! But I've tried a million methods to no avail. I just want a more condense way to hide/make visible multiple pages and subforms simultaneously, or barring that to reset the visibility to the default.</p>