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

Question

Question

embed upload file

asked on March 8, 2017

I saw at empower that in Forms when  you have them upload a photo, it could become part of the form? How is that done?

0 0

Replies

replied on March 8, 2017

You can use Custom JavaScript to achieve it, following is the sample code you can use, but this won't work when download submitted form or save form to repository.

$(document).ready(function () { 
    displayUploadImage (true)
});

$(document).on('updatevalidation',function(){
  if($("input[name='routingResumeId']").val() == '') 
    displayUploadImage (false)  
});

function displayUploadImage(isAll) {
    var iml = ['jpg','jpeg','gif','png'];
    var total= $('.files tbody .file').length;
    $('.files tbody .file').each(function(index) {
        if(isAll){
            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 class="image"><td colspan=3>'+imr.prop('outerHTML')+'</td></tr>').insertAfter($(this).find('a').closest('tr'));

            }
        }
        else
            if(index=== total-1)
            {
              if ($(this).find('a').length && $.inArray($(this).find('a').attr('title').match(/\.(\w{3,4})$/)[1],iml)>-1&&(!$(this).next('.image').length)){
                    var ims = $(this).find('a').attr('href'),
                        imr = $('<img style="width:300px;" />');
                    imr.attr('src',ims);
                    $('<tr class="image"><td colspan=3>'+imr.prop('outerHTML')+'</td></tr>').insertAfter($(this).find('a').closest('tr'));

                }
            } 
    })
}

 

1 0
replied on March 9, 2017

Thank you for the code. We were looking for some way to have our forms be 1 page, with details and image combined.

 

Currently we are having to manually add the pages after it is submitted into laserfiche. 

0 0
replied on February 12, 2019

I remember seeing that too and would like to be able to embed documents that have been uploaded to Laserfiche into forms also.

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

Sign in to reply to this post.