6 Replies Latest reply on Oct 30, 2017 9:03 AM by charlie3878

    Show/Hide one field, why doesn't my Javascript work?

    Charlie6067

      I'm using Acrobat DC Pro.

       

      I am trying to show or hide a field based on the calculated total that appears in a field named NVCA Raw Score. The calculated field has possible numbers of 0 - 7. If the calculated field displays number 0 - 4, I want to hide the FLAGGED field. If the calculated fields displays numbers 5, 6, or 7, I want the hidden field to display. I've tried my best to cobble some JavaScript together from other scripts using < >, but the hidden field never displays. I've learned a lot from this group, but still need help every once in a while. Any help will be very appreciated.

       

      var nResult = this.getField("NVCA Raw Score").value;

      if ( nResult >= 4 ) {

      this.getField("FLAGGED").display = display.visible;

      }

      else if ( nResult <= 4 ) {

      this.getField("FLAGGED").display = display.hidden;

      }

       

      Many thanks,

      Charlie

      charlie6067