Posts

Showing posts from November, 2018

Custom dialog box for SharePoint online

Image
Custom Jquery dialog box made easy Custom dialog box or popup functionality on SharePoint pages using JavaScript can be implemented very easily. Start with adding some space holder in your html to be the container of your popup. Copy the code from below: <html> <body>     <div id="divTermsParent">         <Div id="divTerms"></Div>         <br />         <button id="btnAccept" onclick="Response(1)">Accept</button>         <button id="btnDecline" onclick="Response(0)">Decline</button>     </div>     <a onclick="OpenDialog();">open dialog</a> </body> </html> Now you need to provide the java script to open the html as popup. For that you will use  SP.UI.ModalDialog.showModalDialog method. Please use the below code for opening the dialog box: function OpenDialog()         {         var h