0

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

Thanks in advance

0

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 '17 at 13:51
  • Can I reload a particular page on button click? – Dheeraj Jun 28 '17 at 13:58
  • not the same page...but I need to reload another page on button click – Dheeraj Jun 28 '17 at 13:59
  • You mean parent page? – Venkat Konjeti Jun 28 '17 at 15:02
0

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

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.