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

Javascript Link on To-Do task form

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?

Labels: (1)
0 Kudos
Reply
4 Replies
Highlighted
Nintex Newbie

Re: Javascript Link on To-Do task form

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>

 

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Javascript Link on To-Do task form

I've tried to do this as well. Regardless the JavaScript and or onclick event get removed during form rendering.
0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Javascript Link on To-Do task form

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(...);
  });
});

 

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Javascript Link on To-Do task form

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.
0 Kudos
Reply