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

Question

Question

Form Upload image in a table cannot view as not enough space, other options?

asked on August 23, 2019

 

Is there a way to take the upload image from the first (or any other) attachment upload variable and place that image into another field at the bottom of the form?

Here's the use:  We have this form that requires supporting documents for each line in the table, however, they are usually pdf's that cannot be combined into one entry within the LF repository.  If the image(s) could be seen within the form submitted upon Save to Repository, then we would not have to manually watch for these and manually convert to tiff and manually add them to the original submission entry form.

Thanks for any help!

0 0

Replies

replied on September 30, 2019

I've got a form that does a little Javascript (got it from one of the Empower conferences) to display an uploaded image file as part of the form.  I've never tried it with a PDF however.

var iml = ['jpg','jpeg','gif','png']; 
  $('.files tbody tr').each(function() { 
    if ($(this).find('a').length && $.inArray($(this).find('a').attr('title').match(/\.(\w{3,4})$/)[1],iml)>-1) { 
      var ims = $(this).find('a').attr('href'), 
        imr = $('<img style="width:300px;" />'); 
      imr.attr('src',ims); 
      $('<tr><td colspan=3>'+imr.prop('outerHTML')+'</td></tr>').insertAfter($(this).find('a').closest('tr')); 
    } 
  });

This code just adds it right after the upload field (which has CSS class of "files").  But you could try tweaking it to insert the image later in the form.

1 0
replied on September 30, 2019

Thanks, Matthew.  I ended up rebuilding the form without the attachment as the last column in the table/collection fields.  I put an upload field after the collection field, separate from everything else so that the images can be viewed in full across the page.  The newly designed form is in testing stage right now, waiting for the users to put a few live submissions through.

I will keep your javascript offering/tip for a backup and for future possible use in other forms.  Thanks!!

1 0
replied on September 30, 2019

Sounds good.

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

Sign in to reply to this post.