This project has moved and is read-only. For the latest updates, please go here.

Issues with Cascading Drop-down in SP 2013 but not SP 2007

Jun 1, 2015 at 5:19 PM
I was able to do this succesfully in SharePoint 2007 but when I move that same code to the SharePoint 2013 environment, it pulls the parent column but the values in the second dropdown are not populating. What am I doing wrong? Any help or guidance you can provide will be much appreciated.

My 2007 code is as follows:
<script language="javascript" type="text/javascript" src="http://share/sites/EForms/Javascript%20Library/jquery-1.3.2.min.js"></script>
<script language="javascript" type="text/javascript" src="http://share/sites/EForms/Javascript%20Library/jquery.SPServices-2013.01.min.js"></script>
<script language="javascript" type="text/javascript"> $(document).ready(function() { $().SPServices.SPCascadeDropdowns({ relationshipList: "Employee ID Numbers", relationshipListParentColumn: "EID", relationshipListChildColumn: "Title", parentColumn: "EID", childColumn: "EmployeeID Number", debug: true }); }); </script>
Jun 1, 2015 at 9:07 PM

I don't see anything wrong with your call to SPCascadeDropdowns. However, you are using a really old version of jQuery and a pretty old version of SPServices. I'd suggest jQuery 1.11.3 and SPServices 2014.02. Also make sure that your script references are still valid (i.e., the .js files are in the right place to match the src.)

Jun 2, 2015 at 2:28 PM
Thank you for the reply. I updated the jQuery and SPServices to those versions and I still get the same result of no values pulling in the second drop-down. Just a little more background. There are three lists that are being used.
List One- has only the Employee's name
List Two- has the employees EID number and their name
List Three- has the EID number and their Payroll ID Number (the Employee ID Numbers list mentioned in the code)

The form itself has two fields called the EID and EmployeeID number that are lookup fields to the above lists.
Jun 2, 2015 at 2:37 PM
If you've upgraded the site and everything has stayed the same exactly the same calls to SPCascadeDropdowns should work.

You might want to add some alerts into your script to make sure everything is loading correctly. See this post:

Jun 2, 2015 at 3:01 PM
That was a big help. I get all of the alerts and they look correct. We migrated using a tool called Content Matrix. I had to recreate the custom newform.aspx and copied and pasted the code from 2007 to 2013 and that was the extent of it. However, it still doesn't pull a value for the second drop-down field.
Jun 2, 2015 at 3:07 PM
Since you have debug: true, you should get a message is any of the column names are incorrect, etc.

Are you sure that you're landing on the custom new form and not the default one? Are you sure you've added the script to that page? (I know, silly questions, but they are exactly the kinds of things I do myself!)

Jun 2, 2015 at 3:11 PM
I just double checked and I did add it to the custom form that I created. I call it New. After I add the code, I click F12 to make sure I'm going from my code to the form. I add the script here:

<%@ Page language="C#" MasterPageFile="~masterurl/default.master" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document" meta:webpartpageexpansion="full" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitle" runat="server">
<SharePoint:ListFormPageTitle runat="server"/>
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server">
<span class="die">
    <SharePoint:ListProperty Property="LinkTitle" runat="server" id="ID_LinkTitle"/>
<asp:Content ContentPlaceHolderId="PlaceHolderPageImage" runat="server">
<img src="/_layouts/15/images/blank.gif?rev=23" width='1' height='1' alt="" />
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
<script language="javascript" type="text/javascript" src="http://share/sites/EForms/Javascript%20Library/jquery-1.11.3.min.js"></script>
<script language="javascript" type="text/javascript" src="http://share/sites/EForms/Javascript%20Library/jquery.SPServices-2014.02.min.js"></script>
<script language="javascript" type="text/javascript"> $(document).ready(function() { alert("jQuery"); alert($().SPServices.SPGetCurrentSite()); $().SPServices.SPCascadeDropdowns({ relationshipList: "Employee ID Numbers", relationshipListParentColumn: "EID", relationshipListChildColumn: "Title", parentColumn: "EID", childColumn: "EmployeeID Number", debug: true }); }); </script> <SharePoint:UIVersionedContent UIVersion="4" runat="server">
<div style="padding-left:5px">
Jun 2, 2015 at 3:19 PM
Sure looks like it is there. I'm not sure what else to suggest. It should work.

Jun 2, 2015 at 3:23 PM
Yea that's what I said. If there was something wrong with the relationship list, would it tell me? One thing I noticed in some of your other blogs is that some of your lists you use contain a lookup field to get the value of that lists field from a previous table. I did not do that in 2007 because we needed a quick way to load over 4000 employees and the lookup columns would force us to do it manually instead of being able to import a spreadsheet with the needed values.