Skip to main content
Known Participant
May 18, 2018
Answered

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

  • May 18, 2018
  • 1 reply
  • 687 views

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 = " ";

This topic has been closed for replies.
Correct answer Bernd Alheit

Don't use a space. Use this:

... = "";

1 reply

Bernd Alheit
Community Expert
Bernd AlheitCommunity ExpertCorrect answer
Community Expert
May 18, 2018

Don't use a space. Use this:

... = "";

Known Participant
May 18, 2018

Perfect! Thanks!