Can’t get value of some form fields

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

Fanski
User
Posts: 33
Joined: Tue Apr 17, 2012 10:33 am

Can’t get value of some form fields

Post by Fanski »

I can’t get the Field Value of some fields.
Could someone have a look at this pdf and tell me how I can get the values of the Fields
Tel, Fax, E-Mail?
this.getField("Antrag[0].Seite1[0].TeilformularDaten[0].Email[0]").value
returns null, but the viewer shows the value “TEST4”

Regards
Peter
You do not have the required permissions to view the files attached to this post.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19868
Joined: Mon Jan 12, 2009 8:07 am

Re: Can’t get value of some form fields

Post by Stefan - PDF-XChange »

Hi Peter,

How were those fields populated? Because while they seem as if data was entered in them, if you click any of those fields - it shows as empty. If I then click in and type something else myself - I can then get the value of the Field.
In fact those fields do not show any content when you open them initially in the Editor.
I can see 3 document level scripts - but those are checking for Adobe's products versions, and should not affect the fields. However - do you think there might be some further JS that could be "wiping clean" those fields every time the document is launched?

Regards,
Stefan
Fanski
User
Posts: 33
Joined: Tue Apr 17, 2012 10:33 am

Re: Can’t get value of some form fields

Post by Fanski »

Hi Stefan,

thank you for your answer.
There seems to be a JS, which can clear the fields. At the bottom of the document are two buttons, the right is for printing, the left is for “clear fields”.
As attachment the original document. I need the user to fill the fields, and after that, I have to read the values.
Is there another way how I can get the displayed value of the fields?
Regards
Peter
You do not have the required permissions to view the files attached to this post.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: Can’t get value of some form fields

Post by Vasyl - PDF-XChange »

Hi, Peter.

There is issue with your test.pdf file. The Tel, Fax, E-Mail fields doesn't contain the text really. They displaying only the 'cached' appearances of non-existing values. You may check it by Adobe Reader - it ignores the cached appearance when value is empty and shows such fields as empty. However, in viewer, if you entered any new value into E-Mail then your script gives the new value correctly...
But, you are right, we found problem with your form(StaticXFA-form): the 'Clear Fields' working but in wrong way - it clears field values but keeps the cached appearance of values and run-time values. But if you will clear_fields/save_doc/close_doc/open_doc - it will produce the same strange result like in your test.pdf - show appearances of non-existing values. It is our issue and we will fix it in next build.

Thanks for report,
Cheers.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Fanski
User
Posts: 33
Joined: Tue Apr 17, 2012 10:33 am

Re: Can’t get value of some form fields

Post by Fanski »

Thanks for the answer.
Hope you can fix it, because we have no influence on the document template.
Please post it here, when you fixed it.

Regards
Peter
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19868
Joined: Mon Jan 12, 2009 8:07 am

Re: Can’t get value of some form fields

Post by Stefan - PDF-XChange »

Hi Peter,

Vasyl asked me to make a ticket in our internal system:
RT#2502: Editor 307.2: "Clear Field"(Formular zuruksetzen) button doesn't work correctly
That will allow us to keep track of this issue and fix it. As soon as it's fixed I will post here in the topic.

Regards,
Stefan