3 Replies Latest reply on Jan 17, 2012 3:52 PM by cclay53

    Dropdown List

    cclay53

      I have dropdown list that contains 8 items. The values are obviously 1-8 and refer to subforms.

      In code I have

      if (this.rawValue ==(1) {

           BaggerSub.presence="visible";

      }

      elseif

           if (this.rawValue == "2"){

           BaggerSub.presence = "visible";

           ZipperSub.presence = "visible";

      endif

       

      The problem is if I select item 1 on the list nothing happens. If Iselect item 2, then the script for item 1 works. If I select item 3 thenthe script for item 2 works.

      I have the scripts in change.

      Any suggestions of where I went wrong.

       

      Thanks

      Craig

        • 1. Re: Dropdown List
          cclay53 Level 1

          Ok new information.

          If i choose an item and then choose it again it will load properly.

          • 2. Re: Dropdown List
            radzmar Adobe Community Professional & MVP

            Hi,

             

            I think you're using the change:Event for your script.

            In this case, the rawValue is not available, as it is set as very last.

            Use xfa.event.newText instead.

            if (xfa.event.newText === "1") {

                 BaggerSub.presence = "visible";

                 ZipperSub.presence = "invisible";

             

            }

            else if (xfa.event.newText === "2") {

                 BaggerSub.presence = "visible";

                 ZipperSub.presence = "visible";

            }

            1 person found this helpful
            • 3. Re: Dropdown List
              cclay53 Level 1

              ok. That doesn't seem o work. But what i did do is move my script from a change event to exit and it works-

               

              Thank you.

              Craig