7 Replies Latest reply on Aug 24, 2011 3:30 AM by try67

    Dropdown value

    jck_drmjn Level 1

      The value of Dropdown are A,B,C.

       

      If "A" select, Text_A will be equal to Text_1. (this.getField("Text_A")=this.getField("Text_1") .value)

       

      What is the code and where should I place it?

       

      I have made code for it but it shows left hand invalid.

        • 1. Re: Dropdown value
          try67 MVP & Adobe Community Professional

          As the combo's validate script, enter this:

           

          this.getField("Text_A").value="";

          this.getField("Text_B").value="";

          this.getField("Text_C").value="";

           

          if (event.value=="A")

          this.getField("Text_A").value=this.getField("Text_1") .value;

          else if (event.value=="B")

          this.getField("Text_B").value=this.getField("Text_1") .value;

          else if (event.value=="C")

          this.getField("Text_C").value=this.getField("Text_1") .value;

           

          etc.

          • 2. Re: Dropdown value
            jck_drmjn Level 1

            Hi,

             

            Thanks. It works well in calculation script.

             

            If check box depends on text field value, what is the code for it?

             

            Example:

             

            If(event.value == "A")

            checkbox.value = "true";

             

            What is the perfect code?

            • 3. Re: Dropdown value
              try67 MVP & Adobe Community Professional

              You need to use the value specified as the Export Value, which is usually "Yes".

              So like this:

              getField("Check Box1").value="Yes";

               

              Another option, probably a better one, is to do it like so:

              getField("Check Box1").checkThisBox(0,true);

              1 person found this helpful
              • 4. Re: Dropdown value
                jck_drmjn Level 1

                Hi,

                 

                Many thanks for help me.

                 

                It does not work.

                 

                I have used under text field:

                 

                if(event.vaue =="A")

                getField("Check Box1").value="Yes";

                 

                I have test for both code. Where am I making mistake?

                 

                Thanks again

                • 5. Re: Dropdown value
                  try67 MVP & Adobe Community Professional

                  First of all, the name of the property is "value", not "vaue".

                  Also, you will need to change the name of the check-box in the second line to match yours. I used "Check Box1" as an example.

                  1 person found this helpful
                  • 6. Re: Dropdown value
                    jck_drmjn Level 1

                    Nice. It works now.

                     

                    Would you tell me following things:

                     

                    if(condition1)

                    {statement1}// this statement will be executed always under condition1

                                   if(condition1_1)   // this condition depends on condition1

                                   {statement2}

                                   else if(condition1_2)

                                   statement2}

                                   else{statement}

                    else if (condition2)

                    {statement}

                     

                    .........

                    ........

                    else

                     

                    What is the easiest code in this case?

                    • 7. Re: Dropdown value
                      try67 MVP & Adobe Community Professional

                      Seems fine to me the way that it is...