Quantcast
Channel: Adobe Community : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 238792

kinda if/then/else but more

$
0
0

I three fields that I am working with. First field is a drop down, second is a text field, and third is a read out based on the text field.

 

If someone picks option 2 of the drop down field and if I have 19 in the txtField I want it to add 2 to the text field making it 21 which would make the read out 5.

 

Problem I am running into is when I pick the drop down option 2 the txtField changes properly but the read out only goes up by 1 digit and doesn't give the right read out.

 

I am not sure the syntax to this or which of the fields in the pdf I should put this script into?

 

I have so far for the drop down:

if (this.getField("optionTwo").value == 'yes') {

var Lit = this.getField("txtField");

event.value = Lit.value+2;

}

 

for the Text field Readout:

 

if (this.getField("txtField").value <= '11') {

event.value = 0

} else if (this.getField("txtField").value <= '13') {

event.value = 1

} else if (this.getField("txtField").value <= '15') {

event.value = 2

} else if (this.getField("txtField").value <= '17') {

event.value = 3

} else if (this.getField("txtField").value <= '19') {

event.value = 4

} else if (this.getField("txtField").value <= '21') {

event.value = 5

} else if (this.getField("txtField").value <= '23') {

event.value = 6

} else if (this.getField("txtField").value <= '25') {

event.value = 7

} else if (this.getField("txtField").value <= '27') {

event.value = 8

} else if (this.getField("txtField").value <= '29') {

event.value = 9

} else if (this.getField("txtField").value == '30') {

event.value = 10

}

 


Viewing all articles
Browse latest Browse all 238792

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>