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

Convert formcalc to javascript

Guest
Oct 11, 2018 Oct 11, 2018

Copy link to clipboard

Copied

Trying to convert following formcalc script to javascript, and not getting to work.  Just wondering if someone could take a look at and possibly convert to javascript?  Thank you so much!    IF(Personnel_nab>=0,Personnel_nab+-Personnel_osb)

TOPICS
Acrobat SDK and JavaScript , Windows

Views

176

Likes

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

correct answers 1 Correct answer

Deleted User
Oct 11, 2018 Oct 11, 2018

OK, thank you!  Very helpful!

Likes

Translate

Translate
LEGEND ,
Oct 11, 2018 Oct 11, 2018

Copy link to clipboard

Copied

Please show us your attempt, so we can help you understand what is wrong rather than just solving the one problem.

Likes

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
Guest
Oct 11, 2018 Oct 11, 2018

Copy link to clipboard

Copied

Sorry, it is incomplete. 

if (Personnel_nab >= 0) {

  Personnel_nab = Personnel_nab+-Personnel_osb;

}

Likes

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
LEGEND ,
Oct 11, 2018 Oct 11, 2018

Copy link to clipboard

Copied

Ok, the key thing you are missing is connecting it to the fields. In JavaScript a name is just a place to keep stuff, not the name of a field unless you do something like this:

var Personnel_nab = this.getField("Personnel_nab") ;

and so on for each field. Then your lines should be OK. Pay very close attention to exact details like the quotes used, punctuation, and capital letters like the F in getField.

Also get in the habit of opening the JavaScript console. If anything goes wrong, your messages will show up only in the console.

Likes

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
Guest
Oct 11, 2018 Oct 11, 2018

Copy link to clipboard

Copied

LATEST

OK, thank you!  Very helpful!

Likes

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