none
Working cascading drop down using javascript in share point 2013 ? RRS feed

  • Question

  • hi

    I am using share point 2013. i want to implement cascading drop down lists in share point form. i tried using SPCD and other snippets from Codeplex but didnt work. can anyone tell me any working javascript for the same ?

    i have 2  dropdowns 

    country which has following values-

    1)India

    2)US

    3)UK

    and states list which has-

    1)Pune

    2)Goa

    3)Manhattan

    4)Chicago

    5)Coventry

    6)Leeds 

    now when i click on India it should only display Goa and Pune (for US Manhattan and Chicago and for UK Leeds and Coventry)

    thanks ,

    JP

    Friday, September 19, 2014 9:08 AM

All replies

  • I'm a fan of SharePoint services. http://spservices.codeplex.com/

    Of course the correct answer is 'What went wrong in particular'?

    Friday, September 19, 2014 10:09 AM
  • Hi JP,

    First create a list called country and add item to Tilte(India,US,UK)

    Title

    ------------

    India

    US

    UK

    Create a list called State and create a lookup field called Country. Add item to  Country and Title.

    Country - Tilte

    ---------------------

    India - Pune

    India - GoaUS - Manhattan

    US - Chicago like this.

    put this code your SharePoint Designer Page. It will work.

    <script language="javascript" type="text/javascript" src="/SPServices/jquery-1.3.2.min.js">
    </script>
    <script language="javascript" type="text/javascript" src="/SPServices/jquery.SPServices-0.7.2.min.js">
    </script>

    <script type="text/javascript" language="javascript">
    $(document).ready(function(){
        $().SPServices.SPCascadeDropdowns({
            relationshipList: "YourListName",
            relationshipListParentColumn: "Country",
            relationshipListChildColumn: "Title",
            parentColumn: "Country",
            childColumn: "State",
            debug: true
        })
    })
    </script>

    Thanks,

    Nattuthurai Kuppusamy


    Nattuthurai.K

    Friday, September 19, 2014 11:02 AM
  • Both the other responses to this thread allude to the SPServices for a reason, they're capable of what you're after.

    Can you elaborate on what happened and maybe we can help fix that issue?

    If that's still not viable, what sort of rights do you have for your site / site collection?


    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles: CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

    Friday, September 19, 2014 11:15 AM
    Answerer
  • hi Steven,

    i followed these steps http://www.sharepointboris.net/js/spcd/

    saved newform.aspx(of the third custom list), tried to add an item but nothing happened. it did not change the second drop down values when i selected the value from first drop down. (for example, i selected microsoft but it showed all the values from the second drop down not just the values for microsoft)

    Wednesday, September 24, 2014 5:57 AM