I don't get the same thing in Acrobat 9 on Windows XP. It would be interesting to see what happens if you copy what you posted here on the forum and use it.
I would suggest changing code like:
if (this.getField('1A').value.length === 0)
To something like this:
if (this.getField('1A').valueAsString.length === 0)
If you use the value property and the field value is numeric (or "true" or "false"), it won't have a length property because the type of the value isn't "string", so it will be undefined. Since the special value of undefined is not equal to zero the code works, but it's a bit misleading. It could be further refined to just:
I had no problems on 3 different versions of Adobe Acrobat Pro for Windows. Therefore, I assume the problem lies with Acrobat Pro for the Mac. We've already decided to dump Acrobat Pro for Mac and setup a virtual machine with Windows and edit our scripted PDFs that way - at least until Adobe fixes issues with their Mac version - it never dawned on me that it would be a Mac version problem. I guess I'll be a lot more suspicious going forward. Thanks George for confirming it worked in Acrobat 9!
I rarely work on PDFs on my mac; the application is very painful to work in (if I'm working with form fields, it does multiple screen redraws whenever I edit the fields, among other things)
Mac Acrobat 10.1.4 on Lion 10.7.5
Clearly a serious bug that needs to be fixed. Meanwhile the project is stalled as there is no workaround other than Windows version.
If you can, try Acrobat 11. There were a number of improvements with the console/debugger, so it may have already been fixed. There are a number of other form authoring related improvements as well (tab order especially) that make it appealing. I don't expect Acrobat 10 will be updated to change this.