Copy link to clipboard
Copied
Total newb to javascript, so pardon my ignorance, but your help would be so much appreciated.
I want to create an invoice with Fields A, B, and C.
What I want C to do:
If A*B is >1 and <50, then C = 50
If A is blank or =0, then C is blank.
Also, would I put the script in the Custom calculation script or Custom Validation Script or elsewhere?
Thank you.
Copy link to clipboard
Copied
What happen if result is not between 1 and 50?
Use script as custom calculation script of field C:
var a = Number(this.getField("A").value);
var b = Number(this.getField("B").value);
var x = a*b;
if(x>1 && x<50)
event.value = 50;
else if(a == "")
event.value = "";
Copy link to clipboard
Copied
Thank you so much for your answer. I will give it a try when I have more time later today.
If the result is >50, then the result is A*B.
So what I'm wanting to do is apply a minium fee if the total does not meet a specific amount.
Copy link to clipboard
Copied
Sorry, to clarify, if A*B is >50, then display the actual result of A*B.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more