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>

1 comment:

  1. I am sure this paragraph has touched all the internet people, its
    really really nice piece of writing on building up new website.


    Feel free to visit my site company of heroes 2 key generator keygenerator *sheldongroup.freehost.pl*

    ReplyDelete

Followers