how to open Modal list form in SharePoint 2013


  • Hi,

    in SharePoint 2010 the following opens a new item form in a Modal dialog, but in SharePoint 2013 it opens the form in a new window:

    <input onclick="javascript:NewItem2(event, &#39;;);javascript:return false;" type="submit" target="_self" value="Add a Course"/>

    In SP 2010 you get a nice pop up modal dialog and the user doesn't leave the page they launched the dialog from.

    In SP 2013 the same code works, but doesn't open the form modally - instead it opens the form in a full page.

    What is the equivalent method for SP 2013 so that I can get the form to open in a modal pop up like in SP2010?


    Monday, September 30, 2013 6:34 AM


  • I've checked the suggested solution, It works in my dev. environment.

    Alternative you can use example of SP.UI.ModalDialog.showModalDialog function

    function dialogfunction(pageUrl) {
    var options = { url: pageUrl, width: 800, height: 600 };
    SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);

    Monday, September 30, 2013 9:52 AM

All replies