I did the same hierarchy as yours. In a blank form i set a text field named as yours and followed by a button also named as yours.And the the code.It seems like the form you did however, your form work and mine did not.I am trying to fix it but i didnt found the problem.
Thank you for answering. I downloaded the file you have sent: it works correctly. However, i created a new form and followed the same steps and the same names of botton and textfield. It didnt works. Another thing, the file you have sent run only in acrobat, is there is an idea that may work on Foxit reader.