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

java script warning - value does not match field

Community Beginner ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

I made a form and it has a field named Performance with a simplified field annotation calculation and percentage applied, I calculate with the name of the fields indicated: (current/previous-1). But when i wrote in others fields the Warning appears: javascript warning - value does not match field. Could someone help me take this warning out of my form and the calculation work?
Thanks

 

TOPICS
JavaScript , PDF forms

Views

496

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 , Jul 23, 2021 Jul 23, 2021

Use this code as the field's custom calculation script:

 

var v1 = Number(this.getField("current").valueAsString);
var v2 = Number(this.getField("previous").valueAsString);
if (v2==0) event.value = "";
else event.value = (v1/v2)-1;

Votes

Translate

Translate
Community Expert ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

This happens when you divide a value by zero.

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 ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

LATEST

Thank you for your help!

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 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

Use this code as the field's custom calculation script:

 

var v1 = Number(this.getField("current").valueAsString);
var v2 = Number(this.getField("previous").valueAsString);
if (v2==0) event.value = "";
else event.value = (v1/v2)-1;

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 ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

Thank you very much! Finally my form works without a warming!!!!!!

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