Copy link to clipboard
Copied
I have the following that works great, but I only want the unitprice to show till a minimum of 10 units are ordered:
var v = Number(this.getField("PlatesOrdered").valueAsString);
if (v>=10){event.value = "131.99";
if (v>19){event.value = "128.9";
if (v>49){event.value = "124.99";
if (v>99){event.value = "122.21";
if (v>249){event.value = "118.70";
if (v>449){event.value = "116.19";
if (v>999){event.value = "113.79";
}}}}}}}
Copy link to clipboard
Copied
Try the forum for Adobe Acrobat.
Copy link to clipboard
Copied
I did not find anything in the forum. I think it involves an "else", but I tried it, got the same result
Copy link to clipboard
Copied
As first line use:
event.value = "0.00";
Copy link to clipboard
Copied
Here is the script I am running. I want is the values are 0.00 till I reach a total of 10 items purchased. I tried adding an if statement of if (v <10{ event.value = "0.00; on the second line, but that does not work
var v = Number(this.getField("PlatesOrdered").valueAsString);
if (v=>10){event.value = "131.99";
if (v>19){event.value = "128.90";
if (v>49){event.value = "124.99";
if (v>99){event.value = "122.21";
if (v>249){event.value = "118.70";
if (v>449){event.value = "116.19";
if (v>999){event.value = "113.79";}}}}}}}
Copy link to clipboard
Copied
As first line use:
event.value = "0.00";
Copy link to clipboard
Copied
This line is incorrect:
if (v=>10){event.value = "131.99";
It should be:
if (v>=10){event.value = "131.99";
Copy link to clipboard
Copied
Also, you don't need all of those curly brackets.