Copy link to clipboard
Copied
I'm making an order form for levels in a supply room. I have a set inventory level say 10. I have a text box to input the level currently on hand. I need to perform a calculation of the difference of the two numbers. That part is easy. I think. So if the level currently on hand is blank then I want the amount to order to be blank or if the amount on hand is equal to our over the amount allowed then it will also be blank. If that makes since. So I was trying to use:
var A = this.getField("Text2");
var B = 10
var D = ((var B - var A))
But I got a syntex error that I can't figure out and then there is the if statements for the blank text fields. If someone could help I would appreciate it.
Thanks
Copy link to clipboard
Copied
You can try this:
var A = Number(this.getField("Text2").valueAsString);
var B = 10;
if(A == 0 || A == B)
event.value = "";
else
event.value = B-A;
What should happen if someone enters more then (B) 10, it should show negative number?
Copy link to clipboard
Copied
In that case, just change: A == B to: A >= B
Copy link to clipboard
Copied
You can try this:
var A = Number(this.getField("Text2").valueAsString);
var B = 10;
if(A == 0 || A == B)
event.value = "";
else
event.value = B-A;
What should happen if someone enters more then (B) 10, it should show negative number?
Copy link to clipboard
Copied
I would like it to be blank
Copy link to clipboard
Copied
In that case, just change: A == B to: A >= B
Copy link to clipboard
Copied
I am still unable to get this formula to work. Is there any way I could emal you the test PDF I am using to see if you could get it to work? if you have Adobe Acrobat Pro that is?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now