locked
Create Custom Modal Modal Dialog in SharePoint 2010? RRS feed

  • Question

  • Hi,

    I have sharepoint list, for that list i have creted custom list forms, in that forms i have hyperlinks for showing other referernce pages, for that i need custom modal dialog.

    How to develop cusotm modal dialog by using Javascripot or JQuery?

    Regards,

    Siva

    Wednesday, July 25, 2012 12:26 PM

Answers

  • By Using javascript....

    <script type="text/javascript"> //User Defined Function to Open Dialog Framework function OpenDialog(strPageURL) { var dialogOptions = SP.UI.$create_DialogOptions(); dialogOptions.url = strPageURL;// URL of the Page dialogOptions.width = 750; // Width of the Dialog dialogOptions.height = 500; // Height of the Dialog dialogOptions.dialogReturnValueCallback = Function.createDelegate( null, CloseCallback); // Function to capture dialog closed event SP.UI.ModalDialog.showModalDialog(dialogOptions); // Open the Dialog return false; } // Dialog close event capture function function CloseCallback(strReturnValue, target) { if (strReturnValue === SP.UI.DialogResult.OK) // Perform action on Ok. { alert("Knowledgebase article successfully created."); } if (strReturnValue === SP.UI.DialogResult.cancel) // Perform action on Cancel. { } } </script> <tr> <td> <a href="/site/Lists/Kowledgebase/newform.aspx"

    onclick="return OpenDialog ('/site/Lists/Kowledgebase/newform.aspx');">

    Create Knowledgebase

    </a> </td> </tr>


    • Marked as answer by Siva Padala Wednesday, July 25, 2012 12:31 PM
    • Edited by Siva Padala Wednesday, July 25, 2012 12:34 PM
    Wednesday, July 25, 2012 12:31 PM