Showing posts with label SPServices; SPCascadeDropdowns; SharePoint 2010. Show all posts
Showing posts with label SPServices; SPCascadeDropdowns; SharePoint 2010. Show all posts

Wednesday, July 31, 2013

Cascade DropDownList in SharePoint 2010 using SPServices SPCascadeDropdowns

When you select a value from protocol dropdownlist branches will be automatically populated.




add below code underneath placeholder or add content editor webpart to your page
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
 

<script language="javascript" type="text/javascript" src="/shared documents/jquery-1.8.2.min.js"></script>
<script language="javascript" type="text/javascript" src="/shared documents/jquery.SPServices-0.7.2.js"></script>
<script language="javascript" type="text/javascript">
    $(document).ready(function () {


        $().SPServices.SPCascadeDropdowns({
            relationshipList: "ListBranches",
            relationshipListParentColumn: "Protocols",
            relationshipListChildColumn: "Title",
            parentColumn: "Protocols",
            childColumn: "Branches",
            debug: true
        });

    });
</script>


I have 2 lists called Protocols and ListBranches.
ProtocolsList Columns
Title
LilstBranches columns
 Title
Protocols (lookup  field)
Cascade List Columns
Title
Branches
Protocols





add below code underneath placeholder or add content editor webpart to your page
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
 

<script language="javascript" type="text/javascript" src="/shared documents/jquery-1.8.2.min.js"></script>
<script language="javascript" type="text/javascript" src="/shared documents/jquery.SPServices-0.7.2.js"></script>
<script language="javascript" type="text/javascript">
    $(document).ready(function () {


        $().SPServices.SPCascadeDropdowns({
            relationshipList: "ListBranches",
            relationshipListParentColumn: "Protocols",
            relationshipListChildColumn: "Title",
            parentColumn: "Protocols",
            childColumn: "Branches",
            debug: true
        });

    });

</script>

Followers