Rule #1 of writing code in Acrobat: Enable the option to show the console on errors and warnings, so you can see immediately what's wrong with your code.
This error message means your field name is incorrect. Keep in mind that JS is case-sensitive, and that you have to include any spaces or other characters that appear in the field name when accessing it.