Skip to main content
Participating Frequently
December 21, 2024
Question

Display lesser amount between two Text Box Amounts

  • December 21, 2024
  • 2 replies
  • 509 views

Hello, I need to make a calculation but I need to claculate (divide) a Text Field with the lowest amounts entered from two different Text Field boxes in percentage. Is there a java script I could use?

 

Text Field 1 = Amount 1

/ Lesser Amount from two text fields

Text Field  2 = Amount 2

Text Field 3 = Amount 2

I need to clacaltue lesser amount between Text 1 and Text 2 to divide Text 3 with.

    2 replies

    try67
    Community Expert
    Community Expert
    December 21, 2024

    I don't see the division in your example, but you can find the lower amount like this:

     

    var amount1 = Number(this.getField("Amount 1").valueAsString);
    var amount2 = Number(this.getField("Amount 2").valueAsString);
    var minAmount = Math.min(amount1, amount2);

    Participating Frequently
    January 2, 2025

    Hello, that didn't work. I am including the pdf sheet I am working on. 

     

    I need to divide Text field 1 byt the text field with the lesser amount Text Fied 2 or Text Field 3

    try67
    Community Expert
    Community Expert
    January 2, 2025

    You need to provide more details, not just say "it didn't work", or share the actual file.

    You say you need to divide Text 1 by the lesser amount, but where should this result appear? There are only three fields in the screenshot you sent. There needs to be another one for the final outcome.

    kglad
    Community Expert
    Community Expert
    December 21, 2024

    is this an acrobat question?

    Participating Frequently
    December 21, 2024

    Yes, this is in PDF.  

    kglad
    Community Expert
    Community Expert
    December 21, 2024

    in the future, to find the best place to post your message, use the list here, https://community.adobe.com/

    p.s. i don't think the adobe website, and forums in particular, are easy to navigate, so don't spend a lot of time searching that forum list. do your best and we'll move the post (like this one has already been moved) if it helps you get responses.



    <"moved from using the community">