We have recently upgraded from SharePoint 2007 to SharePoint 2010. Now whenever a user clicks on a workflow to run on a list item it opens the initiation form in a new window. I have gotten 20+ complaints on this issue but cannot find where I can change the workflow anchor links to remove target="_blank". Is there a way to customize the dialog that lists the workflows that you can run on the items? Perhaps I can inject a JavaScript file to remove the target attribute?

2 Answers 2


Since workflows are listed in application page (_layouts/Workflow.aspx) two options for customization (remove the target attribute via JavaScript) are preferable here:

1 Add the JavaScript reference using Custom Action (ScriptSrc)

 <Elements xmlns="http://schemas.microsoft.com/sharepoint/">

2 Add the JavaScript reference to the Master Page (for example, via SPD)

For more details about Custom Action usage and another options please follow article REFERENCING JAVASCRIPT FILES WITH SHAREPOINT 2010 CUSTOM ACTIONS USING SCIPTSRC

  • In case anyone in the future needs assistance with this there are a couple of gotcha's that you should consider. First being that the links are generated on the fly so you need to run the jQuery AFTER the page is fully loaded and all links are populated. You can wrap the code from Benny's answer above in a window.setTimeout(removelinks(), 500) to have it execute after the links are populated on the screen. Secondly gotcha is that once the user runs the workflow the popup window does not close so you will need to find a way to have it close after the workflow has been run.
    – LukeP
    Nov 13, 2013 at 18:36
  • What I did to fix the second problem stated in my above comment was to change Benny's code to this $('a[target="_blank"]').attr('target','_parent'); this makes it so that rather than opening in a new tab it will target the current window.
    – LukeP
    Nov 13, 2013 at 19:12

You can do this using jQuery:


Reference: jQuery/JavaScript - Remove All target="_blank"

  • Thank you for the code but I do not know where to put it. Is there some place in SharePoint designer that I can go to place this snippet so that it applies to the Workflow popup window?
    – LukeP
    Nov 12, 2013 at 19:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.