Skip to main content
add more calirification
Source Link

Try thisto use the following code within a Script Editor / Content Editor:

 <script>
function openDialog(pageUrl) { 
var options = {
    url: pageUrl,
    title: 'Title of the Dialog',
    allowMaximize: false,
    showClose: true,
    width: 500,
    height: 500
};
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);       
}
 
  
</script> 
<a href="#" onclick="openDialog('http://SharePointSite/Lists/WebEvents/NewForm.aspx');">New Form</a>

Note :

  • To show Maximize button set allowMaximize: true,

OutPut:

enter image description here

Check also the detail steps that matched with your situation at Open a link via Modal Dialog in SharePoint

Try this code:

 <script>
function openDialog(pageUrl) { 
var options = {
    url: pageUrl,
    title: 'Title of the Dialog',
    allowMaximize: false,
    showClose: true,
    width: 500,
    height: 500
};
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);       
}
 

</script> 
<a href="#" onclick="openDialog('http://SharePointSite/Lists/WebEvents/NewForm.aspx');">New Form</a>

OutPut:

enter image description here

Try to use the following code within a Script Editor / Content Editor:

 <script>
function openDialog(pageUrl) { 
var options = {
    url: pageUrl,
    title: 'Title of the Dialog',
    allowMaximize: false,
    showClose: true,
    width: 500,
    height: 500
};
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);       
}
  
</script> 
<a href="#" onclick="openDialog('http://SharePointSite/Lists/WebEvents/NewForm.aspx');">New Form</a>

Note :

  • To show Maximize button set allowMaximize: true,

OutPut:

enter image description here

Check also the detail steps that matched with your situation at Open a link via Modal Dialog in SharePoint

Source Link

Try this code:

 <script>
function openDialog(pageUrl) { 
var options = {
    url: pageUrl,
    title: 'Title of the Dialog',
    allowMaximize: false,
    showClose: true,
    width: 500,
    height: 500
};
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);       
}


</script> 
<a href="#" onclick="openDialog('http://SharePointSite/Lists/WebEvents/NewForm.aspx');">New Form</a>

OutPut:

enter image description here