You are viewing limited content. For full access, please sign in.

Question

Question

Is it possible to save image previews using custom HTML Fields?

asked on August 19, 2014

 Hey Gang, 

I'm using Forms as a content generation method. Customer needs image previews on the finalized form for reviews/approvals. 

I'm using a custom HTML function (here's a link to a JSFiddle http://jsfiddle.net/Xotic750/AjtLx/) to provide a pretty decent image preview solution. This solution works well, however- upon submission the image previews are completely gone. When the customer submits the form, I'd like to be able to see the previewed image flattened on the form- which it is not doing currently. Is there a way to do this or should I focus my efforts more on the base upload method? Is there something I'm missing?

 

Thanks,

HB

0 0

Answer

APPROVED ANSWER
replied on August 28, 2014

Check out this post. Basically, you need to store the HTML encoded version of the image in a single line field, not custom HTML. Then, when the form loads, you check to see if the single line field has a value, and if it does, you decode it back into an image and place that custom HTML.

 

If you want to see all of the signatures code, look here.

0 0

Replies

replied on August 19, 2014

Hi,

 

I hope to see an answer as well. I have thought about this functionality with the previews but thought that due to what I saw with other aspects of Forms, that I would run into this problem as well. 

 

I think that because you are using javascript, while you are actually inserting into view these documents, you are not actually saving that view to the saved HTML that is used to generate the PDF when saving to the repository. 

 

Have you tried using the "append" method to add in the HTML equivalent to what you are trying to accomplish? I think the appendChild might be giving you the trouble you are experiencing.

0 0
replied on August 19, 2014 Show version history

The code in your JSFiddle runs when the image is uploaded, which is great for the initial submission. You'll also need to handle the case where the image is already uploaded and present on the form. This will make your image previews show up later in the process.

 

The code for signatures actually has something like this already, where the signature image is captured on the form and then HTML encoded and stored in a field. When the form opens later, the data is decoded back into an image and placed on the form.

0 0
replied on August 28, 2014

Hey Eric, 

Do you have a link where I can learn more about the signatures aspect? I'm having trouble finding any details on the support site at the moment. 

0 0
APPROVED ANSWER
replied on August 28, 2014

Check out this post. Basically, you need to store the HTML encoded version of the image in a single line field, not custom HTML. Then, when the form loads, you check to see if the single line field has a value, and if it does, you decode it back into an image and place that custom HTML.

 

If you want to see all of the signatures code, look here.

0 0
replied on August 28, 2014

So if we follow the information on that first link, we should be able to store these images directly when the form is saved? Would it potentially be able to be modified to save an image of an iFrame when a user hits submit?

0 0
replied on August 28, 2014

If you get the image to show up on the form when the form loads, it should appear on the copy saved in Laserfiche.

0 0
replied on August 22, 2014

Hi Hunter, 

 

If your question has been answered, please let us know by clicking the "This answered my question" button on the response.

 

If you still need assistance with this matter, just update this thread. Thanks!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.