function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Open Link in visualforce in new window, not within VF page

I created a related list of Opportuinity Approval History, purely to remove the Submit for approval button.

Now this sits in the detail of the opportnuity page but when someone clicks on the Recall/Approve/Reject links it opens the page within the visualforce and not in a new window.
Does anyone know how I can open these links in a new tab or page

<apex:page StandardController="Opportunity">
      <apex:relatedList list="ProcessSteps" ></apex:relatedList>
 <script src=""></script> 

 $(document).ready(function() {  
Emmanuel Cruz BEmmanuel Cruz B
Hi Cushty,

You need to set target attributes on links and modify the onclick action in the input button. You can try with the following:
$(document).ready(function() {  
    var piRemoveJsAction = $("div[id$='MyProcess']").find("input[name='piRemove']").attr('onclick');
    var pattern = /http+[a-zA-Z0-9:.%?=&_\-\/]*/;
    var newJsAction = "'"+piRemoveJsAction.match(pattern)+"', '_blank')";
    $("div[id$='MyProcess']").find("input[name='piRemove']").attr('onclick', newJsAction);

Hope this helps you.
Emmanuel Cruz