Launching Attachments in New Window

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
maxb57
Posts: 1
Joined: Tue Jun 14, 2016

15 Jun 2014

I am investigating Forms Designer to solve the following problem. Right now, when a list edit form is displayed, the user has to right click the attachment link and choose "view in a new window" in order to be able to view the form and the attachment simultaneously. Using Forms Designer (with Sharepoint Online) can I place a button on the form that will launch the attachment in a new window? Let's assume there is only one attachment. What would be even better would be the ability to size both the form and the attachment side by side on the screen so that the user does not have to change window placement themselves.

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

17 Jun 2014

Hello,
It isn't necessary to open the attachment dialog in a separate window. You can drop Attachments field anywhere onto your form with Forms Designer and view it as well as any other field. If you click Attach File button on the ribbon, you will see a dialog where you can choose the attachment, click OK and return to the form where you will see the selected file and will be able to delete it or choose another one.

Image

Valdas Kalibatas
Posts: 1
Joined: Wed Apr 06, 2016

07 Apr 2016

Hi,

I have the same issue with viewing the attachments. It opens the attached file in the same window. Is here any way to add to the attachment file link the attribute of target="_blank" and make on the click to open in onother window?

Thank you,
Val

User avatar
rostislav
Moderator
Posts: 364
Joined: Mon Oct 19, 2015

08 Apr 2016

Well, the a element uses an MS function DispDocItemExWithServerRedirect in its onclick attrbitue (check the a element's html) to open attachments. The function treats different attachments differently and there is some logic to it - and I assume it's there for a reason. What you can do is remove the onclick property from the a's DOM and assign target=_blank to it, which will open the attachment as another window - however, do note that this will stop the function from being triggered.

Code: Select all

 fd.field('Attachments').control()._el().find('a').removeProp('onclick').prop('target',

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 13 guests