• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

NEED HELP WITH JAVASCRIPT IF STATEMENTS

New Here ,
Jul 03, 2020 Jul 03, 2020

Copy link to clipboard

Copied

I need to calculate the following in FieldC calculation.

IF FIELDA is greater than FIELDB then FIELDB value goes into FIELDC.

 

Can anyone help me do this??

 

you're help would be greatly appreciated.

TOPICS
Acrobat SDK and JavaScript

Views

258

Translate

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 ,
Jul 03, 2020 Jul 03, 2020

Copy link to clipboard

Copied

Hi,

 

You would need to use something like :

 

var FIELDA = this.getField ("FIELDA").value;

var FIELDB = this.getField("FIELDB").value;

if ( FIELDA > FIELDB) {

    this.getField("FIELDC").value = FIELDB;

}

 

This is just a quick example.

 

Regards

 

Malcolm

Votes

Translate

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
New Here ,
Jul 12, 2020 Jul 12, 2020

Copy link to clipboard

Copied

LATEST

Thank you for helping me out but I guess I didn't add that if FieldA is less than or equal to FieldB then the value in FieldC should be the value of FieldA.

 

Could you help me with that.

 

And, would you know how to validate a field so that if the amount input is greater than another specified field it would show an error and not allow the input.

Votes

Translate

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 ,
Jul 03, 2020 Jul 03, 2020

Copy link to clipboard

Copied

What about if it's not, though?

Votes

Translate

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