0 Replies Latest reply on Mar 16, 2017 6:32 PM by pdfUser1

    Combining scripts, one more time.

    pdfUser1 Level 1

      As all of you guys know creating forms and docs are ever changing. And, here I am in the middle of creating mine. I want to thank you guys for helping me with issues I've come up with. Now, I believe I've come up with yet another solution. A solution I'd like to use but can't figure out how to combine these scripts.


      What I came up with is a drop down that has 0%, 10%, 15%, 20%, etc. This is the script I have to just show/hide the fields.



      this.getField("ItemA.1").display = event.value=="0%"? display.hidden : display.visible;
      this.getField("Itemb.1B").display = event.value=="0%"? display.hidden : display.visible;



      At the moment I'm using two separate buttons to trigger the following scripts.


      Button to show:

      var f = this.getField("Item.1");
      f.alignment = "left";
      var f = this.getField("Itemb.1B");
      f.display = (f.valueAsString=="") ? display.hidden : display.visible;
      var f = this.getField("ItemA.1");
      f.display = (f.valueAsString=="") ? display.hidden : display.visible;



      Button to hide:

      var f = this.getField("Item.1");
      f.alignment = "center";
      this.getField("Itemb.1B").display = display.hidden;
      this.getField("ItemA.1").display = display.hidden;
      this.getField("Itemb.2B").display = display.hidden;
      this.getField("ItemA.2").display = display.hidden;

      I have tried many times with the little experience I have to combine these scripts so the would be triggered from the drop down but needless to say, I couldn't get it. So, here I am seeking help. Can someone please come to my rescue? Thanks again, guys.