4 Replies Latest reply on Aug 18, 2015 1:59 PM by gkaiseril

    Document Level Conditional Javascript - Please Help!

    nathans12868517

      I'd like to show/hide fields based on radio button responses, but the third party integration I'm using to capture form data does not allow for execution of field Javascript, but will allow for document-level scripts.

       

      I can't get my script to work, please help!


      {  var a = this.getField("Choices").value;

         function ShowMe()

         if (a == "Choice1")

         {

            this.getField(“Text1").display = display.visible;

            this.getField(“Text2").display = display.hidden;

            this.getField(“Text3").display = display.hidden;

         }

      else if (a == “Choice2")

         {

            this.getField(“Text1").display = display.hidden;

      !      this.getField("Text2").display = display.visible;

            this.getField(“Text3").display = display.hidden;

         }

      else if (a == “Choice3")

         {

            this.getField(“Text1").display = display.hidden;

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

            this.getField(“Text3").display = display.visible;

         }

         else if (a == “Choice4")

         {

            this.getField(“Text1").display = display.visible;

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

            this.getField(“Text3").display = display.visible;

         }

         else

         {

            this.getField(“Text1").display = display.hidden;

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

            this.getField(“Text3").display = display.hidden;

         }

      }