cancel
Showing results for 
Search instead for 
Did you mean: 
spences
Nintex Newbie

How do you set attachements to open in a new window?

Jump to solution

Hi, I currently have nintex mobile forms setup for audit purposes. In these there is the ability to capture photograhs. These forms are being sent into sharepoint for all central parties to see. When viewing the forms there is the ability to click onto the attacments for which open in the same window which means a lot of clicking back and forth and reloading of the browser. Is there a way I can set these attacments to open in a new window to avoid this pain? Thanks

Labels: (1)
Tags (1)
Reply
8 Replies
andrew_x_childr
Nintex Newbie

Re: How do you set attachements to open in a new window?

Jump to solution

I'm using Nintex forms on premises, so this might not be applicable to the mobile version, but I've come up with a custom JavaScript solution that will make attachments open in a new tab:

NWF$("document").ready(function() {
NWF$('[id*="idAttachmentsTable"]').click(function() {
NWF$('tbody tr td a').attr("target", "_blank");
});
});
Reply
spences
Nintex Newbie

Re: How do you set attachements to open in a new window?

Jump to solution

Andrew. Seems quite simple so thanks for this.

Where in the NINTEX form creator is best for this code to be placed? Would this go into the "Custom Java Script" in Form Settings, under "Custom CCS includes" within Advanced or "Custom Javascript includes" within the Advanced tab?

Thanks again

0 Kudos
Reply
andrew_x_childr
Nintex Newbie

Re: How do you set attachements to open in a new window?

Jump to solution

The first option, in Custom JavaScript under Custom CSS in Form Settings.  I will be interested to know if this works for you on Nintex Mobile.

0 Kudos
Reply
andrew_x_childr
Nintex Newbie

Re: How do you set attachements to open in a new window?

Jump to solution

Tweaking it this morning, this version of the code is simpler and also works:

NWF$("document").ready(function() {
 NWF$('tbody tr td a').attr("target", "_blank");
});
Reply
bimi82
Nintex Newbie

Re: How do you set attachements to open in a new window?

Jump to solution

This works great provided the user does not click the Add Attachment link as below otherwise there is a problem.

However, if the user clicks the add attachment icon instead then it works.

Hint: maybe adding the .pdf only attribute would rule it out??

0 Kudos
Reply
daveg00
Nintex Newbie

Re: How do you set attachements to open in a new window?

Jump to solution

thanks, that looks like a good fix Andrew, I have tried it on premises, but cant get it to behave.  Am I missing something?  I have put the code into custom javascript.  A form opened in read mode with an attached pdf still opens in the same window, requiring back to go back to the form. 

0 Kudos
Reply
dinafischer
Nintex Newbie

Re: How do you set attachements to open in a new window?

Jump to solution

I have the On Prem version and it works perfectly for m me.

0 Kudos
Reply
spences
Nintex Newbie

Re: How do you set attachements to open in a new window?

Jump to solution

Andrew, thanks for the response and resolution. I did try this and could not get this to work either.

A simple solution got me around this without having to alter any custom scripting at all. Simply hold CTRL when clicking on the image and it opens in a new web page.

Simple but effective.

Reply