Skip to main content
This topic has been closed for replies.
Correct answer Karl Heinz Kremer

I assume this comes from the Actions Exchange on AcrobatUsers.com. Are you getting the error with the unmodified script as well? If not, what have you changed in the code (and for what purpose)?

Your subject line refers to a NaN error - how does that factor into this problem?

A "NaN" error is thrown when a "Not a Number" condition occurs, that can for example be that you are trying to perform an operation that can only be done with a number on a string, or if you try to divide by zero.

2 replies

Karl Heinz  Kremer
Community Expert
Karl Heinz KremerCommunity ExpertCorrect answer
Community Expert
July 1, 2016

I assume this comes from the Actions Exchange on AcrobatUsers.com. Are you getting the error with the unmodified script as well? If not, what have you changed in the code (and for what purpose)?

Your subject line refers to a NaN error - how does that factor into this problem?

A "NaN" error is thrown when a "Not a Number" condition occurs, that can for example be that you are trying to perform an operation that can only be done with a number on a string, or if you try to divide by zero.

July 1, 2016

Sorry, the actual error I get is:

"If selected, the initial Value for Doc Number must be filled out with a valid integer")

Not the one documented in the initial post.

validate: function(dialog)

        {

            var oRslt = dialog.store();

            if(oRslt["DocN"] && ( (oRslt["DNum"] == null) || (oRslt["DNum"] == "")  || isNaN(oRslt["DNum"]) ) )

            {

                app.alert("If selected, the initial Value for Doc Number must be filled out with a valid integer");

                return false;

            }