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

The value entered does not match the format of the field: java script

New Here ,
May 18, 2018 May 18, 2018

Copy link to clipboard

Copied

I am having issues with one of my scripts. I have a sequence where I check a box and information from one field goes to another. This scripts does exactly that. But when I unchecked the box, it's supposed to remove the information from the field that was populated. When I do this, I get an error saying "The value entered does not match the format of the field ("main house")", which is the name of the field. Both these fields are formatted into numbers. The only way I can fix this is formatting it to a non-number. I don't get it because it populates just fine when they are formatted to numbers. Only when unchecked to remove the info it does this. Is there anyway to fix the javascript where it will work when the field is formatted to a number? This is what I have for the javascript on the checkbox.

if (getField("Box1price").value=="Yes")

this.getField("main house").value = this.getField("Landmark Price").value;

if (getField("Box1price").value=="Off")

this.getField("main house").value = " ";

TOPICS
Acrobat SDK and JavaScript , Windows

Views

219

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

Community Expert , May 18, 2018 May 18, 2018

Don't use a space. Use this:

... = "";

Likes

Translate

Translate
Community Expert ,
May 18, 2018 May 18, 2018

Copy link to clipboard

Copied

Don't use a space. Use this:

... = "";

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
New Here ,
May 18, 2018 May 18, 2018

Copy link to clipboard

Copied

LATEST

Perfect! Thanks!

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