Skip to main content
Nintex Community Menu Bar
Solved

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


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

Best answer by andrew_x_childr

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");
});
});
View original
Translate
Did this topic help you find an answer to your question?

10 replies

Forum|alt.badge.img+5

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");
});
});
Translate

  • Author
  • 2 replies
  • May 23, 2017

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

Translate

Forum|alt.badge.img+5

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");
});
Translate

Forum|alt.badge.img+5

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.

Translate

Forum|alt.badge.img+1
  • 3 replies
  • July 18, 2017

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. 

Translate

  • Author
  • 2 replies
  • November 20, 2017

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.

Translate

Forum|alt.badge.img+11
  • 340 replies
  • April 11, 2018

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??

Translate

Forum|alt.badge.img+7
  • 49 replies
  • March 8, 2019

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

Translate

NWF$("document").ready(function() {

    NWF$('[id*="idAttachmentsTable"]').click(function() {

        NWF$('tbody tr td a:nth-child(1)').attr("target", "_blank");

    });

});

 

Needs the :nth-child(1) on a element so you can delete a saved attachment.

The :nth-child(1) catches only the attachment link and not the whole element

Translate

Forum|alt.badge.img+1
  • Rookie
  • 3 replies
  • November 16, 2023

Thank you, Papasotiriou!!  This was needed for us to still be able to delete saved attachements… much appreciated!

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings