These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Edit data being on import from xfdf.

RatePro
Registered: Sep 1 2010
Posts: 7

Hello!

The PDF form already has a "$" statically placed.
The data that is being dynamically loaded (imported from xfdf) also has a "$."
How do I remove, via javascript in the PDF form field, the "$" from the imported data before it is committed and displayed?

Thank you,
Jerry

RatePro

My Product Information:
Acrobat Pro 9.3.1, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
You can use the following as the field's custom Validate script:

event.value = event.value.replace("$", "");
RatePro
Registered: Sep 1 2010
Posts: 7
Hi George,
Thank you for replying!

I did exactly that firstly and it did not do the job. Hence my post.

A lot of other apps grab the same data and require the formatting, which is why I'd like to solve this issue on the PDF side.

Do have any other ideas for me?

Thanks,
Jerry

RatePro

George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
That's odd. So are you saying that the field starts out empty, and when you import the XFDF (how are you doing that, exactly?) that the field is filled but with the leading dollar sign? Did you create the form in Acrobat or LiveCycle Designer?
RatePro
Registered: Sep 1 2010
Posts: 7
PDF is existing 3rd-party PDF to which I added the fields I want to populate w Acrobat 9 Pro.
I believe the code uses CutePDF API on the database/file server to set the field values from a stored XFDF file.
By the time I see it, the PDF is populated and flattened - ready for printing.
Maybe the code commits the data and flattens it too soon for the field javascript to affect it...?

So...that's the assuption I have gone with, and am now getting it done in the code.

I really appreciate your help. Going forward a PDF side solution would be best, but....oh well.

Thanks again,
Jerry

RatePro

George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
I see. It is unlikely that the code in the Validate event is executed at all when filling the fields using the CutePDF Form SDK, as it would be if you were using Acrobat to import the data.

Can you edit the PDF to remove the preexisting dollar sign?
RatePro
Registered: Sep 1 2010
Posts: 7
I can change the code once, or edit 50 or so PDFs.
:-) I'm staying with the code solution.

Thanks much, George!
Jerry

RatePro