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

Question

Question

When I open a task, can I automatically have the uploaded file open too?

asked on August 30, 2018 Show version history

We have a step in the process where the Doc Control Administrator opens the task and opens the one (it's limited to just one) uploaded file and conducts a review of what's attached to the metadata placed in the form. Can I, on form open, also have the uploaded for open too, maybe through a javascript?

0 0

Answer

SELECTED ANSWER
replied on August 31, 2018 Show version history

Hi Gloria,

I got the following code to do the trick, you just need to ensure that popup blocking is turned off for the user's Forms server domain and that the ID reference ('#q1' below) is updated to reflect the ID of the relevant field on your form.

(function() {  
  function openDoc() {
    var url;
    url = $('#q1 a.ellipsis').attr('href');
    $(document).on('click', '#q1 a.ellipsis', function() {
      window.open(url);
    });
    $('#q1 a.ellipsis').click();
  }
  
  $(document).ready(function() {
    setTimeout(openDoc(), 1000);
  });
})();

Edit: spelling and clarification.

2 0
replied on September 4, 2018

Perfect, thank you!

0 0
replied on January 18, 2019 Show version history

So, now I'd like it to open all the attachments (for an upload that is not required but can allows many files to be uploaded). With the code above, It only opened the first file attached.

Oh, and I actually have two upload buttons … one only allows a single file and the other allows zero-to-many files to be uploaded.

0 0

Replies

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

Sign in to reply to this post.