Home > CMS- Content Management System > Sharepoint > How to Open a List Form in a Bootstrap Modal Dialog Box?

How to Open a List Form in a Bootstrap Modal Dialog Box?

This post was most recently updated on August 5th, 2024

In SharePoint list setting under advanced Settings link, SharePoint provide option for Launch forms in a dialog box. But it’s very difficult to manage responsiveness and other custom control management in the dialog box.. So in this post I share how to Open a List Form in a Bootstrap Modal Dialog Box.

Steps:

  • Create page and open in share point designer.
  • In PlaceHolderMain add following CSS and JS files.

    <asp:Content ContentPlaceHolderId=”PlaceHolderMain” runat=”server”>
    <link rel=”stylesheet” type=”text/css” href=”https://SiteAssets/Styles/css/bootstrap.min.css” ms-design-css-conversion=”no” />
    <link rel=”stylesheet” type=”text/css” href=”//SiteAssets/Styles/css/DialogForm.css” ms-design-css-conversion=”no” />
    <script type=”text/javascript” src=”https:/SiteAssets/Styles/js/jquery-2.1.4.min.js”></script>
    <script type = “text/javascript” src = “https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js”></script>
    <script src=”https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js”></script>
    <script type=”text/javascript” src=”https://SiteAssets/Styles/js/DialogForms.js”></script>

  • Insert New Item Form of required list in page page. This will generate code of new form in <table> structure.
  • Edit table structure into bootstrap model div so add bellow code into <xsl:template name=”dvt_1.rowinsert”>

     

  • Add custom class to Save and Cancel button. Below I add class mainSaveBtn mark as a rectangle.
  • Add below js code in document ready.
  • Add following css to open dialog.

    .formModelDialog{
    top: 25%;
    color: #444;
    background-color: #E1E2E3;
    max-width: 767px;
    min-height: 380px;
    margin: 0px auto;
    font-family:Segoe UI,Segoe,Tahoma,Helvetica,Arial,sans-serif;
    font-size: 16px;
    box-shadow: 0px 0px 30px 0px rgba(0,0,0,0.47);
    border: 1px solid black;
    }

  • Add button in page to open dialog box.

  • At last click on above button to open dialog box.

    Dialog Box

This Article is TAGGED in , , , . BOOKMARK THE permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">