Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
0

If Greater than Multiple by

New Here ,
Sep 12, 2024 Sep 12, 2024

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

TOPICS
Create PDFs , JavaScript , PDF , PDF forms

Views

1.1K
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Sep 12, 2024 Sep 12, 2024

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}

View solution in original post

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 23, 2024 Dec 23, 2024

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...

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines