I have a code that opens any DispForm.aspx
link into a modal dialog. The item has a link to another DispForm.aspx
-- is it possible to open this on another modal?
I tried inserting the following code below <asp:Content ContentPlaceHolderId="PlaceHolderTitleAreaClass" runat="server">
in a custom DispForm.aspx
<script type="text/javascript">
$(document).ready(function(){
setInterval(function () {
$("a[href*='DispForm.aspx']").each(function () {
$(this).attr("onclick", "openDialog('" + $(this).text() + "','" + $(this).attr("href") + "')");
$(this).attr("href", "javascript:void(0)");
$(this).removeAttr("target");
});
}, 900);
}
function openDialog(title, url) {
var options = {
url: url,
width:650,
height:700,
//autoSize: true,
title: ""
};
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
}
I also tried adding the code in a script editor in DispForm.aspx.