Solved

Is there a way to force links in Forms to open in a new tab?

  • 13 October 2015
  • 6 replies
  • 282 views

Badge +4

Is it possible to force links to open in a new tab from a Form?

 

I have a workflow that creates a subfolder in a Doc Library and then writes the link back into the form. It'd be nice if when the user views the form, they click the link and it opens into a new tab.

icon

Best answer by christopheraucq 19 October 2015, 11:28

View original

6 replies

Badge +9

Hi Jonathan,

How do you write the link?

If you can add target="_blank" in your a href tag, it should solve you issue.

<a target="_blank" href="http://your_url_here.html">Link</a>

Regards,

Christophe

Badge +4

Hi Christophe,

I use the Set Field in Current Item > Encoded Absolute URL

Badge +9

Hi Jonathan,

You need a Nintex Form for your Doc Library

For your DocFolder field Control Settings, under Formatting, for CSS class, append  cssfldDocFolder.

It should appear like this: nf-form-input cssfldDocFolder

Then can create a Rich Text Control in the Form.

In this control, under Formatting, in CSS class, fill in MyRichTextControlClass

In Form Setting, under Custom Javascript

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

    var strDocFolder=NWF$('.cssfldDocFolder').text();

    NWF$('.MyRichTextControlClass').html('<a target='_blank' href=''+strDocFolder+''>'+strDocFolder+'</a>');

});

Please note that this will work in View mode only, this is why we get the value of DocFolder using CSS instead of Javascript value: .val()

Regards,

Christophe

Badge +4

Thanks! I'll give this a shot.

Badge +4

Hey Christophe,

When I added the CSS class, MyRichTextControlClass and Custom Javascript, it made everything blank on the form upon publishing.

Badge +9

Hi Jonathan,

This means that your Javascript code is not well formed.

Please follow this link to make sure it is right

https://community.nintex.com/community/dev-talk/blog/2015/06/23/video-writing-custom-javascript-in-nintex-forms-for-shar…

Regards,

Christophe

Reply