Check the JS console for errors.
I don't think the trim method is supported in Acrobat.
Do you have any suggestion? solution etc how it can be done?
Very carefully check your field names and the names used in your code.