Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


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

45

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

Adobe Community Professional , 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;

Likes

Translate

Translate
Adobe Community Professional ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

This happens when you divide a value by zero.

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

Copy link to clipboard

Copied

LATEST

Thank you for your help!

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
Adobe Community Professional ,
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;

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

Copy link to clipboard

Copied

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

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