Quantcast
Channel: Adobe Community : Popular Discussions - Adobe Digital Enterprise Platform (Read Only)
Viewing all articles
Browse latest Browse all 43112

IF Else (javascript) with a range of numbers

$
0
0

I am creating form fields in a PDF using Acrobat.  There is a field which you enter an amount (1-20, 21-100, 100+) and depending on what is entered the cost will be different.  So if 1 thru 20 units are entered the cost will be $199 per unit, 21 thru 100 units the cost is $175 per unit and 100+ units the cost is $150 per unit.  The line on the document looks like:  Number of Entities___ X Price per Entity___= Total___. 

 

This is what I have so far to get the price;

 

if (this.getField("No. of Entities").value == '1') {

event.value = 199

} else if (this.getField("No. of Entities").value == '21') {

event.value = 175

} else if (this.getField("No. of Entities").value == '101') {

event.value = 150

} else {

event.value = 0 // Default value here

}

 

I have it working for a single number, I just can't get a range of numbers.

 

Any help would be great, thanks.


Viewing all articles
Browse latest Browse all 43112

Latest Images

Trending Articles



Latest Images

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