Skip to main content
dtackerwvu
Participant
January 17, 2019
Answered

Tons of format errors in a fillable PDF form, when you go to fill the form

  • January 17, 2019
  • 2 replies
  • 3766 views

Hoping the community can help me. I know enough to be dangerous but javascript, etc, are outside my typical functions.

I created a form for some manual testing we perform in our laboratory. [The current form is in xls and the operators consistently and inadvertently delete equations, etc.] This form took me half a day to "get working" as it was my first form with fields that relied on other fields. The calculations are relatively straightforward and I was very careful to check and double-check my simple scripting for the calculations needed.

Everything looked pretty good and my preview went fine. So I saved the form, closed it, and then opened it to fill it out. Fields unrelated to any calculation field in the document fire pretty much as soon as I fill in the first field, date. I get 4 or 5 pop-up error boxes stating that the format of the field does not match that of the fields doing calculations....these fields have NOTHING to do with any calculation in the form!!! As it stands, though the calculations do work, it takes too long to frustratingly clear all those error boxes, every single time a field is completed. So my techs will not use this - they will hate it, because I'm already foaming at the mouth with anger - but I don't want to lose all this work and the promise of a functional form that even looks good for printing and showing to inspectors, providers, etc, if questions ever arise.

I know someone in this community can help me. Please feel free to reach out with some kind of tip. But if it's all javascript-y, I'll probably have immense trouble understanding it. Please forgive the very-steep learning curve that I'm trying to climb. I tried to attach the form to the thread but there was no option, and a drag and drop failed. Happy to send it via email for someone to check/review.

Thank you!!

Danyel

This topic has been closed for replies.
Correct answer try67

These error messages typically happen when you have a Number field with a calculation where the divisor is the value of another field. When the latter is empty (or zero) you're in effect doing division by zero, which is not allowed and then you get this error message. It will appear each time you edit any field in the file, whether or not that field has anything to do with the calculated field that's causing this issue.

The solution is to use a script to perform the calculation and add an if-condition in it where if the divisor is zero, apply an empty string to the field.

2 replies

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
January 17, 2019

These error messages typically happen when you have a Number field with a calculation where the divisor is the value of another field. When the latter is empty (or zero) you're in effect doing division by zero, which is not allowed and then you get this error message. It will appear each time you edit any field in the file, whether or not that field has anything to do with the calculated field that's causing this issue.

The solution is to use a script to perform the calculation and add an if-condition in it where if the divisor is zero, apply an empty string to the field.

dtackerwvu
Participant
January 17, 2019

This sounds like my problem 100%. I looked in some forums to see if I could match some code to my scenario, basically:

if the value of ADJSTD>0, then calculate SC1BL/ADJSTD

else (leave this field blank)

But honestly I had no understanding of how to express it in script. This is literally the same division problem on 5 different materials, using the same value for ADJSTD (the adjusted standard value). So if I had a template I know I could substitute the other numerators in the correct calculations.

Currently with my equations broken, filling the form is a dream but I don't get any results I can use clinically, LOL.

Thanks to everyone for their fast replies! I do appreciate it!

dtackerwvu
Participant
January 17, 2019

I came up with a low-tech solution, since I am not a programmer. I'm pre-loading the form with a "1" in each of the fields for the blank readings. That way, the only field in the form creating a denominator is always at least 1! So far as I can tell it's working fine now. Maybe one day I will learn enough to code, to advance this.

Bernd Alheit
Community Expert
Community Expert
January 17, 2019

What format does you use in the fields?

dtackerwvu
Participant
January 17, 2019

Hi Bernd!

I used:

  • date for the date field (m/d/yy)
  • no formatting for the text/mixed fields like names, chart numbers
  • number, no decimals for the input fields
  • number, no decimals for the fields doing the calculations (we need whole number results)

I couldn't really see a way to "create a section" like I can do in a "Word-type" document.

Bernd Alheit
Community Expert
Community Expert
January 17, 2019

For the calculated number fields you get an error message when you divide by zero.