Skip to main content
warrick_lee
Participant
October 4, 2016
Answered

Create an image insert button in a pdf form that clears once the user hits a submit form or reset form button?

  • October 4, 2016
  • 1 reply
  • 2412 views

I am updating a company form that was originally created in Livecycle Designer, by a user who has left the company, which had an attach image button.  The company purchased acrobat pro dc for me, thinking that I would be able to update the form, however it is not able to be edited and so I re-created the form in pro dc.

I can have the user insert a PDF image using the javascript

event.target.buttonImportIcon();

However not being a javascript familiar, and still learning acrobat, this is as far as I can get in the previous forums before I get lost.

The javascript works fine to get the image, however doesn't clear once the reset form or submit form buttons are used.

Can anyone please give me simple and clear instructions on how to do this?

P.S.  Adobe website does not mention anything about not being able to edit livecycle designer forms in other versions of acrobat, so I am already very frustrated.  Therefore please make replies newby friendly.

This topic has been closed for replies.
Correct answer try67

You can't clear it directly. What you can do is a kind of a hack, which is to copy the icon of a button that has no icon applied to it.

So you create an image button (it can be hidden), set it to have an icon, but then don't actually select one.

When you want to reset your other button you can use this code:

this.getField("Image1").buttonSetIcon(this.getField("EmptyImage").buttonGetIcon());

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
October 5, 2016

You can't clear it directly. What you can do is a kind of a hack, which is to copy the icon of a button that has no icon applied to it.

So you create an image button (it can be hidden), set it to have an icon, but then don't actually select one.

When you want to reset your other button you can use this code:

this.getField("Image1").buttonSetIcon(this.getField("EmptyImage").buttonGetIcon());

warrick_lee
Participant
October 5, 2016

Thankyou try67, but I'm still a little confused, sorry.

I create my button "image1" which I set to run the javascript; event.target.buttonImportIcon();

Do I then need to create a "EmptyImage" button which is hidden, and then I need my "ResetForm" button to run the javascript you suggest?

If it is something different to this, can you please step me through it, as this doesn't work.

try67
Community Expert
Community Expert
October 5, 2016

Yes, that's pretty much it.

On Wed, Oct 5, 2016 at 11:50 PM, warrick_lee <forums_noreply@adobe.com>