0

I'm using SharePoint Online

I found this link on how to open a hyperlink in Modal -- but how do I apply it in my tag? clicking the link doesn't do anything.

<script>
function openModelDialogPopup(strPageURL) {  
var dialogOptions = {  
url: ‘https://tenant.sharepoint.com/Lists/ListName/item/newifs.aspx’,  
title: ‘ModalDialog’,  
allowMaximize: false,  
showClose: true,  
width: 800,  
height: 330  
};  
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', dialogOptions);  
return false;  
}   

</script>
<a href="#" onclick="openModelDialogPopup">CALL-IN</a>
  • try openModeDialogPopup() and remove the strPageURL in line 2 – Mike Nov 3 '17 at 20:10
  • @Mike - I tried and still does nothing. – Tamras Merin Nov 3 '17 at 20:17
1

Try doing this:

replace your while <script> block with this

<script type="text/javascript">function openModeDialogPopup() { 
SP.UI.ModalDialog.showModalDialog({ 
url: "https://tenant.sharepoint.com/Lists/ListName/item/newifs.aspx", 
title: "ModalDialog", 
allowMaximize: false, 
showClose: true,
width: 800,  
height: 330  
}); 
}; 

</script>

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.