Skip to main content
Nintex Community Menu Bar

Javascript Link on To-Do task form

  • June 30, 2020
  • 4 replies
  • 41 views

Forum|alt.badge.img+3

I need to have a popup window on my task form to allow users to see the list of documents belonging to them. I have tested the following link on a web part page and pasted it into the description section of the To-Do task:

<a onclick="return openDialog('{Common:WebURL}/Pages/Documents.aspx?rid={ItemProperty:ID}',1000,800)" href="javascript&colon;void(0);" target="_blank"><font face="arial" size="2">View Documents </font></a></b>

However once the task form is created clicking the link does nothing. Upon inspection of the element I see that the link has rendered like this:

<a target="_blank"><font face="arial" size="2">View Documents </font></a>

So what am I doing wrong? Is there another way to accomplish what I need (open an existing page in a pop-up window? Or is this just not possible from the task form?

4 replies

Forum|alt.badge.img+8
  • Novice
  • July 1, 2020

Hi @tast,

can´t you just omit the "return"

like: 

<a onlick="openDialog(...)" href="javascript&colon;void(0)" target:"_blank">View Documents</a>

 or using the href directly to call your function, as you have href property anyways:

<a href="javascript&colon;openDialog(...)" target:"_blank">View Documents</a>

 


Forum|alt.badge.img+3
  • Author
  • July 1, 2020
I've tried to do this as well. Regardless the JavaScript and or onclick event get removed during form rendering.

Forum|alt.badge.img+8
  • Novice
  • July 2, 2020

Hi @tast,

have you tried adding the click via script?

<a id="viewDocuments" ...>View Documents</a>

 and in JS section of the form:

NWF$(document).ready(function () { var viewDocuments = document.getElementById("viewDocuments"); viewDocuments.addEventListener("click", function (e) { openDialog(...); }); });

 


Forum|alt.badge.img+3
  • Author
  • July 6, 2020
We are not using Nintex forms just the straight To-Do task out of the box so unfortunately I don't have the ability to add code.