4 Replies Latest reply on Jul 30, 2015 1:20 PM by kmc27

    Getting "TypeError: f is null" With All Checkboxes

    kmc27 Level 1

      My form has multiple check boxes. Whenever I check or uncheck any of them, the Javascript Debugger displays this message.

       

      TypeError: f is null

      1051:byteCodeTool

      TypeError: f is null

      1051:byteCodeTool

       

      Since this happens with every check box on the form, I am not sure where to start. What is the error telling me, and how do I troubleshoot this problem?

        • 1. Re: Getting "TypeError: f is null" With All Checkboxes
          gkaiseril MVP & Adobe Community Professional

          Just having the fields on a form should not cause any errors like you are describing.

           

          The error you are describing occurs when calculations, formatting, validation, or other actions are done using JavaScript either by entering JavaScript code or by selecting field names for Acrobat to process in some manner. What else are your doing with your form?0

           

          The variable "f" is expected to be field object that has used the "this.getField()" method to obtain the field object for the named field but the field does not or no longer exist.

           

          Have you renamed any fields. if so check your calculations to make sure they are still using the correct field.

          • 2. Re: Getting "TypeError: f is null" With All Checkboxes
            kmc27 Level 1

            I do have javascript doing validations, and did use the field properties calculate functionality to sum a few fields. The form has been modified a few times, I may have inadvertently changed a field name when making the changes. Thanks for the ideas on where to look. I did correct an incorrectly named field, and now the error is slightly different. I will keep looking. Thanks again for the ideas on what the error is telling me. Does the numeral in the error "5: mean anything in terms of where to look for this error?

             

            TypeError: f is null

            5:Field:Mouse Exit

            • 3. Re: Getting "TypeError: f is null" With All Checkboxes
              gkaiseril MVP & Adobe Community Professional

              There is a standard format for JavaScript console errors.

               

              TypeError: f is null - the error message

               

              1051:byteCodeTool - the line number and the possible source of the code.

               

              If you are knowledgeable  about how to use the JavaScript debugger you might be able to find the code and trace it back to the source call.

               

              Your error is coming from the precompiled code provided by Adobe as part of Acrobat Reader. The code is several thousand lines long and provides all the predefined formats and calculations.

               

              Another common error deals with the result of a calculation not matching the format for the field. For this error I change the format to "None" to see what the result value is. Then it is a matter of trying to figure out why it is displaying what is being displayed. Division by zero is NaN and mixing numbers and strings creates a long number or a string of numbers and symbols.

              • 4. Re: Getting "TypeError: f is null" With All Checkboxes
                kmc27 Level 1

                OK, got the form cleaned up, the errors are gone. I had multiple fields that referenced (via a javascript) a field that had been deleted. I had forgotten about the script on those fields when I deleted the no longer needed field. Thanks for your guidance in how to interpret these error messages.