I need to open a SharePoint form from an image button but in a modal dialog box. Is that possible?

Thanks in advance

3 Answers 3


You can do it using following JavaScript.

function openDialog(){
    var pageUrl = "your form url";
    var options = { url: pageUrl, width: 700, height: 600};
    SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
  • This one worked..But I need to reload the page after saving..cause as of know is is not reloading automatically
    – Dheeraj
    Jun 28, 2017 at 13:51
  • Can I reload a particular page on button click?
    – Dheeraj
    Jun 28, 2017 at 13:58
  • not the same page...but I need to reload another page on button click
    – Dheeraj
    Jun 28, 2017 at 13:59
  • You mean parent page? Jun 28, 2017 at 15:02

Make a reference to SP15ModalDialog.js on your page, then you can do stuff like

<span class="addNew" onclick="openInDialog(870,850,true,true,false,&#39;https://...myPage.aspx?IsDlg=1&#39;)">label</span>

See https://gist.github.com/javierguerrero/5249652dea3d389727e0 for details

You can append &IsDlg=1 to the end of the link to hide the ribbon and navigation bars


You can change the default dialog options on a list or library...

List / Library Settings > Advanced Settings > Dialogs

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.