Unable to get cascade to work on SP Site

Jan 7, 2011 at 6:22 PM

Please help. I've been trying to follow the instructions for the Cascading Dropdowns for my Sharepoint Site and have been unsuccessful.

I have the following lists created:

  • Cities (contains Cities listed in the Title field)
  • Towns (contains Towns listed in the Title field and a lookup to the Cities list Title field loabelled City)
  • ZipCodes (contains ZipCodes in the ZipCode field and a lookup to the Towns list Title field labelled Town)
  • Working List in the NewForm view. Which contains three fields: City, Town, ZipCode - each having lookups to their Title field (or ZipCode)

Here is my code on the NewForm version of Working List in a CEWP:

<script language="javascript" type="text/javascript" src="http://REMOVED/Shared%20Documents/jquery.SPServices-0.5.8P1.js"></script>
<script language="javascript" type="text/javascript" src="http://REMOVED/Shared%20Documents/jquery.SPServices-0.5.8P1.min.js"></script>

<script language="javascript" type="text/javascript">
 $(document).ready(function() {
  $().SPServices.SPCascadeDropdowns({
   relationshipList: "Towns",
   relationshipListParentColumn: "City1",
   relationshipListChildColumn: "Title",
   parentColumn: "City1",
   childColumn: "Town",
   debug: true
  });
  $().SPServices.SPCascadeDropdowns({
   relationshipList: "ZipCodes",
   relationshipListParentColumn: "Town",
   relationshipListChildColumn: "ZipCode",
   relationshipListSortColumn: "ID",
   parentColumn: "Town",
   childColumn: "ZipCode"
  });
 });
</script>

Please advise what I am doing wrong...I get no error messages...it just doesn't work at all.

Thank you,

Melissa

Coordinator
Jan 7, 2011 at 7:51 PM
Edited Jan 8, 2011 at 6:43 PM

Melissa:

You're referencing both the minified and non-minified versions of SPServices (you should only reference one), but you're not referencing jQuery itself.

You need to download jQuery from http://jquery.com and reference it, too. For example:

<script language="javascript" type="text/javascript" src="http://REMOVED/Shared%20Documents/jquery-1.4.4.min.js"></script>
<script language="javascript" type="text/javascript" src="http://REMOVED/Shared%20Documents/jquery.SPServices-0.5.8P1.min.js"></script>

The first page of the documentation shows more info on this toward the bottom of the page.

M.

Jan 8, 2011 at 6:41 PM

Thank you for your quick response.

The first cascade is working, now that I added the jquery, but the second cascade for zipcode isn't. All it says to "Choose ZipCode..." but there are no zip codes in the dropdown to select.

What did you mean the first page of documentation?

Please let me know if you need me to post any additional information.

Thank you,

Melissa

Coordinator
Jan 8, 2011 at 6:45 PM

Melissa:

Odds are you have the naming wrong in the second call or something. Try adding the debug option there to see if you get an error. It's also possible that your list data isn't set up right, but I can't tell about that. It sounds like you probably have it right.

The page I was referring to is here:
http://spservices.codeplex.com/documentation

M.

Jan 12, 2011 at 6:32 PM

I was able to get everything to work properly..thank you.

Is there any way to speed the cascades up...they take a while to load. Unfortunately my company uses IE6 and we aren't permitted to use a later version.

Thank you,

Melissa

Coordinator
Jan 12, 2011 at 7:11 PM
Glad you got it working. The main performance issue will be your SharePoint server response time, rather than the browser, in most cases. I don't do any caching intentionally to ensure valid values, so every change fires off some Web Services calls. There's an 'expense' to having this improved functionality. M.