Copy link to clipboard
Copied
I am trying to create a pdf javaScript formula that calculates if a field is greater than 2 multiple that field's value by 25 but not to exceed $250
Copy link to clipboard
Copied
Use the following custom calculation script:
var fld=this.getField("theField").value;
if(fld>2)
{event.value=fld*25}
else
{event.value=""}
if(event.value>250)
{event.value=250}
Copy link to clipboard
Copied
NB. Line-breaks don't matter, if you include a semi-colon after each line, but it's good practice to properly format your code with line-breaks and indentations.
NBB. This is JavaScript, not Java. Similar names, but quite different languages...