Skip to main content
KROUP
Participant
1月 21, 2019 5:59 午後 UTC
質問

How to you troubleshoot the error "the value entered does not match the format of the field"?

How to you troubleshoot the error "the value entered does not match the format of the field"?  The message is being generated more than 50 times in the file.  You have to click OK on each of the messages before you can do anything else in the file.  When you edit the javascript you get the same error message but may reference another field.

このトピックへの返信は締め切られました。

返信数 4

Bernd Alheit
Community Expert
Community Expert
1月 21, 2019 6:10 午後 UTC

Do you use divisions in your calculations?

翻訳
KROUP
KROUP作成者
Participant
1月 21, 2019 6:28 午後 UTC

No, just sums.  See example below.  Field1 is a text field with a value of "." or "yes".  Fields 2, 3, and 4 are total fields of numbers.  The *1 is being used to get the formatting needed of the number without decimal places. 

var a=this.getField("field1");

var b=this.getField("field2");

var c=this.getField("field3");

var d=this.getField("field4");

if (a.value=="yes"){event.value=''}

else

event.value=b.value+c.value+d.value*1;

if (event.value==0||event.value=='') {event.value=''};

翻訳
try67
Community Expert
Community Expert
1月 21, 2019 6:56 午後 UTC

Change this line:

event.value=b.value+c.value+d.value*1;

To:

event.value=Number(b.value)+Number(c.value)+Number(d.value);

翻訳