0

I have created a Survey app on my page of my Sharepoint Online 2013. For that, I want to display them on a Modal Dialog box upon loading a web page. Please advise me with javascripts or jquery suggestions.

1

You can use inbuilt modal popup functionality of SharePoint which SP.UI.ModalDialog.showModalDialog

Try this link

    <script language="javascript" type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>  
<script language="javascript" type="text/javascript">  
    $(document).ready(function() {  
        SP.SOD.executeFunc('sp.js', 'SP.ClientContext', showModalPopUp);  
    });  

    function showModalPopUp() {  
        //Set options for Modal PopUp  
        var options = {  
            url: '/sites/HOL/Pages/Custom-Publishing-Page.aspx?IsDlg=1', //Set the url of the page  
            title: 'SharePoint Modal Pop Up', //Set the title for the pop up  
            allowMaximize: false,  
            showClose: true,  
            width: 600,  
            height: 400  
        };  
        //Invoke the modal dialog by passing in the options array variable  
        SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);  
        return false;  
    }  
</script>  
  • Hey Shridhar, thanks for the scripts! It work well to what i needed! – XxMFxX Apr 13 '18 at 3:18

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.