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
Sandhya K 10Sandhya K 10 

Using jQuery and navigate to a VF page

Hi ,

I have a created a simple VF page
<apex:page standardController="Delivery__c" sidebar="false" >
<apex:relatedList list="Addresses__r"/>
</apex:page>
Now I have added this VF page to a section on a custom Object : Delivery__c details pagelayout . And is shown as expected.
VF page added in a section of page layout
But the problem is when i click on New Address , it opens in the section  and not in a new window.
User-added image
 Is there a way that I can override the New ​Address button and navigate it to another VF page or open in a new window ?
Lokesh KumarLokesh Kumar
Hello Sandhya,

Please change your VF page like below or you can use same and let me know if this worked for you.
 
<apex:page standardController="Delivery__c" sidebar="false" >
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"/>
<script >
$j = jQuery.noConflict();
$j(document).ready(function() {
$j('a').attr("target","_blank");
});
</script > 
<apex:relatedList list="Addresses__r"/>
</apex:page>

Thanks
Lokesh
Sandhya K 10Sandhya K 10
Hello Lokesh,

Thank you so much. I tried , but it did not work. Still opening inside the section and not in a new window.