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

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

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

i was thinking to start  with something like this

if (event.value=="1")

but i can not go on

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

• ###### 3. Re: If text1 has the value 02 then text2 has the value 01 and text3 the value 02

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

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)

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

• ###### 5. Re: If text1 has the value 02 then text2 has the value 01 and text3 the value 02

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

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