6 Replies Latest reply on Feb 16, 2016 11:56 PM by klothos

    If text1 has the value 02 then text2 has the value 01 and text3 the value 02

    klothos Level 1

      I have text1 text2 text3 text4 text5 text6 text7 text8 text9 and text10

      If text1 has the value 01 then text2 has the value 01

      If text1 has the value 02 then text2 has the value 01 and text3 the value 02

      If text1 has the value 03 then text2 has the value 01 text3 the value 02 text4 the value 03

      If text1 has the value 04 then text2 has the value 01 text3 the value 02 text4 the value 03 text5 the value 04

      If text1 has the value 05 then text2 has the value 01 text3 the value 02 text4 the value 03 text5 the value 04 text6 the value 05

      If text1 has the value 06 then text2 has the value 01 text3 the value 02 text4 the value 03 text5 the value 04 text6 the value 05 text7 the value 06

      If text1 has the value 07 then text2 has the value 01 text3 the value 02 text4 the value 03 text5 the value 04 text6 the value 05 text7 the value 06 text8 the value 07

      If text1 has the value 08 then text2 has the value 01 text3 the value 02 text4 the value 03 text5 the value 04 text6 the value 05 text7 the value 06 text8 the value 07 text9 the value 08

      If text1 has the value 09 then text2 has the value 01 text3 the value 02 text4 the value 03 text5 the value 04 text6 the value 05 text7 the value 06 text8 the value 07 text9 the value 08 text10 the value 09

      please help

        • 2. Re: If text1 has the value 02 then text2 has the value 01 and text3 the value 02
          klothos Level 1

          i was thinking to start  with something like this

          if (event.value=="1")

          but i can not go on

           

          2016-02-15 12:45 GMT+02:00 try67 <forums_noreply@adobe.com>:

           

          If text1 has the value 02 then text2 has the value 01 and text3 the value

          02 created by try67 <https://forums.adobe.com/people/try67> in

          JavaScript - View the full discussion

          <https://forums.adobe.com/message/8497197#8497197>

           

          • 3. Re: If text1 has the value 02 then text2 has the value 01 and text3 the value 02
            try67 MVP & Adobe Community Professional

            I'll get you started...

             

            if (event.value=="01") this.getField("text2").value = "01";

            • 4. Re: If text1 has the value 02 then text2 has the value 01 and text3 the value 02
              klothos Level 1

              Hello

              ok i use this

              if (event.value=="01") this.getField("ΤΑΞΙΔΙ1").value = "01";

              if (event.value=="02") this.getField("ΤΑΞΙΔΙ1").value = "01";

              this.getField("ΤΑΞΙΔΙ2").value = "02";

              if (event.value=="03") this.getField("ΤΑΞΙΔΙ1").value = "01";

              this.getField("ΤΑΞΙΔΙ2").value = "02";this.getField("ΤΑΞΙΔΙ3").value = "03";

              if (event.value=="04") this.getField("ΤΑΞΙΔΙ1").value = "01";

              this.getField("ΤΑΞΙΔΙ2").value = "02";this.getField("ΤΑΞΙΔΙ3").value = "03";

              this.getField("ΤΑΞΙΔΙ4").value = "04";

              if (event.value=="05") this.getField("ΤΑΞΙΔΙ1").value = "01";

              this.getField("ΤΑΞΙΔΙ2").value = "02";this.getField("ΤΑΞΙΔΙ3").value = "03";

              this.getField("ΤΑΞΙΔΙ4").value = "04";this.getField("ΤΑΞΙΔΙ5").value = "05";

              if (event.value=="06") this.getField("ΤΑΞΙΔΙ1").value = "01";

              this.getField("ΤΑΞΙΔΙ2").value = "02";this.getField("ΤΑΞΙΔΙ3").value = "03";

              this.getField("ΤΑΞΙΔΙ4").value = "04";this.getField("ΤΑΞΙΔΙ5").value = "05";

              this.getField("ΤΑΞΙΔΙ6").value = "06";

              if (event.value=="07") this.getField("ΤΑΞΙΔΙ1").value = "01";

              this.getField("ΤΑΞΙΔΙ2").value = "02";this.getField("ΤΑΞΙΔΙ3").value = "03";

              this.getField("ΤΑΞΙΔΙ4").value = "04";this.getField("ΤΑΞΙΔΙ5").value = "05";

              this.getField("ΤΑΞΙΔΙ6").value = "06";this.getField("ΤΑΞΙΔΙ7").value = "07";

              if (event.value=="08") this.getField("ΤΑΞΙΔΙ1").value = "01";

              this.getField("ΤΑΞΙΔΙ2").value = "02";this.getField("ΤΑΞΙΔΙ3").value = "03";

              this.getField("ΤΑΞΙΔΙ4").value = "04";this.getField("ΤΑΞΙΔΙ5").value = "05";

              this.getField("ΤΑΞΙΔΙ6").value = "06";this.getField("ΤΑΞΙΔΙ7").value = "07";

              this.getField("ΤΑΞΙΔΙ8").value = "08";

              if (event.value=="09") this.getField("ΤΑΞΙΔΙ1").value = "01";

              this.getField("ΤΑΞΙΔΙ2").value = "02";this.getField("ΤΑΞΙΔΙ3").value = "03";

              this.getField("ΤΑΞΙΔΙ4").value = "04";this.getField("ΤΑΞΙΔΙ5").value = "05";

              this.getField("ΤΑΞΙΔΙ6").value = "06";this.getField("ΤΑΞΙΔΙ7").value = "07";

              this.getField("ΤΑΞΙΔΙ8").value = "08";this.getField("ΤΑΞΙΔΙ9").value = "09";

              and it works,but i have values into all Texts.When i delete the value in

              Text1 the values are still there,and when i write the value for examble 03

              the 9 Texts have all the values (Text2=01 Text3=02............Text10=09)

              A little bit help please

               

              2016-02-15 15:26 GMT+02:00 try67 <forums_noreply@adobe.com>:

               

              If text1 has the value 02 then text2 has the value 01 and text3 the value

              02 created by try67 <https://forums.adobe.com/people/try67> in

              JavaScript - View the full discussion

              <https://forums.adobe.com/message/8497551#8497551>

               

              • 5. Re: If text1 has the value 02 then text2 has the value 01 and text3 the value 02
                try67 MVP & Adobe Community Professional

                If you want to include multiple statements under a single if-command then you need to place them between curly brackets, like this:

                 

                if (condition) {

                     command1;

                     command2;

                     command3;

                }

                • 6. Re: If text1 has the value 02 then text2 has the value 01 and text3 the value 02
                  klothos Level 1

                  OK first i used this calculation script

                   

                  if (event.value=="01") this.getField("ΤΑΞΙΔΙ1").value = "01";

                  this.getField("ΤΑΞΙΔΙ2").value = "00";this.getField("ΤΑΞΙΔΙ3").value = "00";

                   

                  this.getField("ΤΑΞΙΔΙ4").value = "00";this.getField("ΤΑΞΙΔΙ5").value = "00";

                   

                  this.getField("ΤΑΞΙΔΙ6").value = "00";this.getField("ΤΑΞΙΔΙ7").value = "00";

                   

                  this.getField("ΤΑΞΙΔΙ8").value = "00";this.getField("ΤΑΞΙΔΙ9").value =

                  "00";if (event.value=="02") this.getField("ΤΑΞΙΔΙ1").value = "01";

                   

                  this.getField("ΤΑΞΙΔΙ2").value = "02";this.getField("ΤΑΞΙΔΙ3").value = "00";

                   

                  this.getField("ΤΑΞΙΔΙ4").value = "00";this.getField("ΤΑΞΙΔΙ5").value = "00";

                   

                  this.getField("ΤΑΞΙΔΙ6").value = "00";this.getField("ΤΑΞΙΔΙ7").value = "00";

                   

                  this.getField("ΤΑΞΙΔΙ8").value = "00";this.getField("ΤΑΞΙΔΙ9").value = "00";

                   

                   

                   

                  if (event.value=="03") this.getField("ΤΑΞΙΔΙ1").value = "01";

                   

                  this.getField("ΤΑΞΙΔΙ2").value = "02";this.getField("ΤΑΞΙΔΙ3").value = "03";

                   

                  this.getField("ΤΑΞΙΔΙ4").value = "00";this.getField("ΤΑΞΙΔΙ5").value = "00";

                   

                  this.getField("ΤΑΞΙΔΙ6").value = "00";this.getField("ΤΑΞΙΔΙ7").value = "00";

                   

                  this.getField("ΤΑΞΙΔΙ8").value = "00";this.getField("ΤΑΞΙΔΙ9").value = "00";

                   

                   

                   

                  if (event.value=="04") this.getField("ΤΑΞΙΔΙ1").value = "01";

                   

                  this.getField("ΤΑΞΙΔΙ2").value = "02";this.getField("ΤΑΞΙΔΙ3").value = "03";

                   

                  this.getField("ΤΑΞΙΔΙ4").value = "04";this.getField("ΤΑΞΙΔΙ5").value = "00";

                   

                  this.getField("ΤΑΞΙΔΙ6").value = "00";this.getField("ΤΑΞΙΔΙ7").value = "00";

                   

                  this.getField("ΤΑΞΙΔΙ8").value = "00";this.getField("ΤΑΞΙΔΙ9").value = "00";

                   

                   

                   

                  if (event.value=="05") this.getField("ΤΑΞΙΔΙ1").value = "01";

                   

                  this.getField("ΤΑΞΙΔΙ2").value = "02";this.getField("ΤΑΞΙΔΙ3").value = "03";

                   

                  this.getField("ΤΑΞΙΔΙ4").value = "04";this.getField("ΤΑΞΙΔΙ5").value = "05";

                   

                  this.getField("ΤΑΞΙΔΙ6").value = "00";this.getField("ΤΑΞΙΔΙ7").value = "00";

                   

                  this.getField("ΤΑΞΙΔΙ8").value = "00";this.getField("ΤΑΞΙΔΙ9").value = "00";

                   

                   

                   

                  if (event.value=="06") this.getField("ΤΑΞΙΔΙ1").value = "01";

                   

                  this.getField("ΤΑΞΙΔΙ2").value = "02";this.getField("ΤΑΞΙΔΙ3").value = "03";

                   

                  this.getField("ΤΑΞΙΔΙ4").value = "04";this.getField("ΤΑΞΙΔΙ5").value = "05";

                   

                  this.getField("ΤΑΞΙΔΙ6").value = "06";this.getField("ΤΑΞΙΔΙ7").value = "00";

                   

                  this.getField("ΤΑΞΙΔΙ8").value = "00";this.getField("ΤΑΞΙΔΙ9").value = "00";

                   

                   

                   

                  if (event.value=="07") this.getField("ΤΑΞΙΔΙ1").value = "01";

                   

                  this.getField("ΤΑΞΙΔΙ2").value = "02";this.getField("ΤΑΞΙΔΙ3").value = "03";

                   

                  this.getField("ΤΑΞΙΔΙ4").value = "04";this.getField("ΤΑΞΙΔΙ5").value = "05";

                   

                  this.getField("ΤΑΞΙΔΙ6").value = "06";this.getField("ΤΑΞΙΔΙ7").value = "07";

                   

                  this.getField("ΤΑΞΙΔΙ8").value = "00";this.getField("ΤΑΞΙΔΙ9").value = "00";

                   

                   

                   

                  if (event.value=="08") this.getField("ΤΑΞΙΔΙ1").value = "01";

                   

                  this.getField("ΤΑΞΙΔΙ2").value = "02";this.getField("ΤΑΞΙΔΙ3").value = "03";

                   

                  this.getField("ΤΑΞΙΔΙ4").value = "04";this.getField("ΤΑΞΙΔΙ5").value = "05";

                   

                  this.getField("ΤΑΞΙΔΙ6").value = "06";this.getField("ΤΑΞΙΔΙ7").value = "07";

                   

                  this.getField("ΤΑΞΙΔΙ8").value = "08";this.getField("ΤΑΞΙΔΙ9").value = "00";

                   

                   

                   

                  if (event.value=="09") this.getField("ΤΑΞΙΔΙ1").value = "01";

                   

                  this.getField("ΤΑΞΙΔΙ2").value = "02";this.getField("ΤΑΞΙΔΙ3").value = "03";

                   

                  this.getField("ΤΑΞΙΔΙ4").value = "04";this.getField("ΤΑΞΙΔΙ5").value = "05";

                   

                  this.getField("ΤΑΞΙΔΙ6").value = "06";this.getField("ΤΑΞΙΔΙ7").value = "07";

                   

                  this.getField("ΤΑΞΙΔΙ8").value = "08";this.getField("ΤΑΞΙΔΙ9").value = "09";

                   

                  and then this custom validation script

                   

                  var v = +event.value;

                   

                  for (var i=1; i<=9; i++) {

                   

                      var f = this.getField("ΤΑΞΙΔΙ"+i);

                   

                      f.display = (i<=v) ? display.visible : display.hidden;

                   

                  }

                   

                  and it works perfect

                   

                  Thanks

                   

                  2016-02-16 12:01 GMT+02:00 try67 <forums_noreply@adobe.com>:

                   

                  If text1 has the value 02 then text2 has the value 01 and text3 the value

                  02 created by try67 <https://forums.adobe.com/people/try67> in

                  JavaScript - View the full discussion

                  <https://forums.adobe.com/message/8500908#8500908>