Page 1 of 1
Launching Attachments in New Window
Posted: 15 Jun 2014
by maxb57
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.
Re: Launching Attachments in New Window
Posted: 17 Jun 2014
by Dmitry Kozlov
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.
Re: Launching Attachments in New Window
Posted: 07 Apr 2016
by Valdas Kalibatas
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
Re: Launching Attachments in New Window
Posted: 08 Apr 2016
by rostislav
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',