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

The value entered does not match the format of the field Syntax Error missing before statement

Community Beginner ,
Nov 22, 2019 Nov 22, 2019

Copy link to clipboard

Copied

Hello,

I'm trying to put in a custom calculation script to solve the error "the value entered does not match the format of the field."  I've followed instructions on prior posts for those who've gotten this error and but am now getting an error in the script "SyntaxError: missing ; before statement 4: at line 5 and i can't figure out what needs to be done to get past this error.  Can someone please help me get past this? Here is my script:

 

 

var numerator = (+getField("UnitPriceRow1").value) - (+getField("CostRow1").value);
var denominator = +getField("UnitPriceRow1").value;
if (denominator !== 0) {
event.value = (numerator / denominator) x 100;
} else {
event.value = "";
}

TOPICS
Acrobat SDK and JavaScript

Views

512

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

Community Expert , Nov 22, 2019 Nov 22, 2019

Use * for the multiplication.

Votes

Translate

Translate
Community Expert ,
Nov 22, 2019 Nov 22, 2019

Copy link to clipboard

Copied

Use * for the multiplication.

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 Beginner ,
Nov 22, 2019 Nov 22, 2019

Copy link to clipboard

Copied

LATEST

Perfect, that did it.

 

Thank you!!

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