I'm using Nintex Forms 2016 and I'm wondering if there is an easy way to make an hyperlink field (tied to a sharepoint column) in display mode to open the URL in a new tab instead of the current one..
I'm using the standard hyperlink control because I have to show the link that is set in that specific column (with URL and description, so it should show the description and link to the URL) and that column is updated by a workflow..
not for what I know..SharePoint hyperlink field is composed by two subfields, one for URL and one for description..no place on how it's rendered..
so, I haven't realized first it's sharepoint hyperlink field. you are right, this filed doesn't allow to customize link attributes OOTB .
but unfortunately after some tests I found out, that sharepoint tries to be super-intelligent and changes provided URL string to something what it thinks the URL should look like. so it eg. prepends protocol specifier (http://, file:// ...) or site URL, etc.
all that (quite significantly) restricts usability of hyperlink-type field.
if you still have chance to change field's datatype, I would suggest to make it numeric field and build whole link definition (html element) on your own.
I faced similar need with link inside a label for a "I agree terms and conditions" checkbox.
1° add a css class name to my label (ex: lblLink)
I realize this is an older post, but I stumbled across it while trying to do the same thing so, I thought I'd add my two cents.
I didn't want to apply this rule to all <a> tags, but I did want to add it to all hyperlink fields on the form.
I decided to look for some other unique-ish identifier, and came across the
Now, I have no idea if this is the same for everyone else out there (please comment if it is or isn't), but it is the same for me even across different site collections. So, I felt this would work well for me.
I then used this line of code and it's working perfectly:
The code finds all <div> objects with that specific 'data-formcontroltypeid'.
Then it finds all <a> objects inside the <div> objects.
Lastly, it applies the target property set to '_blank' to the <a> object.
And actually, in my case, I took it a step further since I know this will only be needed when in Display Mode:
var isDisplayMode = document.location.pathname.indexOf("/DispForm.aspx") > -1;
if (isDisplayMode) NWF$("div[data-formcontroltypeid='a0c89d70-0781-4bd4-8623-a73675005a05'] a").prop('target','_blank');