CasCadeDropDown not working

Apr 9, 2012 at 6:43 PM
Edited Apr 9, 2012 at 6:44 PM

Hi Marc,

First of all i would like to thank you for sharing this very substantial information over the web and we are really benefitting most specially on the time and effort we need to cram to create this amazing functionality. I really like the cascade dropdown approach and this tool is what i really need. But i'm having a problem running it our sharepoint. below is the detail information and i think i have followed the documentation, blogs and discussion on error i received.

For the lists:

1. i have created a lists called "Continents" inside of this lists are just name of Americas, Europe and Asia under the title column.

2. i have created another lists called "Countries" which contain on Title name of the countries for different continents, and i added a column named "Continent" which lookup values from the lists "Continents".

3. I have created a document library called Credential. Inside this library i have created a column named "Continent" which lookup values from "Continents" and "Country" which lookup values from "Countries.

4. I added the script on CEWP and tried it also inside the page. but it does not work. please see below the script i used:

 

<script type="text/javascript" language="javascript" src="../jQuery Libraries/jquery-1.7.2.min.js"></script>
<script type="text/javascript" language="javascript" src="../jQuery Libraries/jquery.SPServices-0.7.1a.min.js"></script>
<script type="text/javascript" language="javascript" src="../jQuery Libraries/jquery.SPServices-0.7.1a.js"></script>
<script type="text/javascript" language="javascript">

$(document).ready(function(){
$().SPServices.SPCascadeDropdowns({
alert("Is Account field on the page? " + ($("[title='Continent']").length > 0 ? "YES", "NO!"));
		relationshipList: "Countries",
		relationshipListParentColumn: "Continent",
		relationshipListChildColumn: "Title",
		relationshipListSortColumn: "ID",
		parentColumn:"Continent",
		childColumn: "Country",
		CAMLQuery: "",
		listName: $().SPServices.SPListNameFromUrl(),
		promptText: "",
		simpleChild: true, // Added in v0.6.2
		selectSingleOption: true, // Added in v0.6.2
		matchOnId: false,     // Added in v0.7.1
		completefunc: null,
		debug: true
	});
</script>

5. I have copied all the javascripts on "Site Assets" and even inside the "Credential" document library. 
I have created a folder named "jQuery Libraries" inside document library and just changed script of the page to try it out, but 
i can't really make it run on my forms.
By following your documentation and online discussions i was able to place them on the correct location the scripts
and code. I'm just following online documentation and tutorial, so i guess i'm just a user that just really wants to use the
shared amazing features you've created.
I will really highly appreciate any comments/ correction that i'm missing or incorrectly place.
Respectfully yours,
baguhanlangako
Apr 9, 2012 at 9:53 PM
Edited Apr 9, 2012 at 9:55 PM

As an added informaton from above:

1. Continent - lists with title column

2. Country - lists with title column + Added a column named "Continent" thru lists settings and lookup value.

3. Created a document library "Credential" + added column named "Continent" and "Country" thru document settings. "Continent" lookup value from Continent lists. "Country" lookup value from Country lists.

4. Added the code and script as CEWP on document library.

 

Apr 10, 2012 at 12:45 AM
I will take a closer look at your code later. But at first look, you need to remove the alert() you have above. JavaScript will throw an Exception. You placed in a location that is invalid.

_____
Paul

Sent from mobile device.
Apr 10, 2012 at 1:12 AM
I agree with Paul, the alert is invalid where you have it–you can find another way to get that functionality working after you get the cascading drop downs working. Also, you are missing (at least in the code you pasted) a }); to close the ready function.

Sent from my iPhone
Apr 10, 2012 at 3:38 PM
Edited Apr 10, 2012 at 3:39 PM

Paul and kramden88,

I both thank you for taking time to read and comment to help me and us reading the discussion. after adding the closing code }); and deleted the alert(); i got the following error:

Error in function
SPServices.SPCascadeDropdowns
Parameter
parentColumn: Continent
Message
Column not found on page

cascade i wanted to create:

Continents --> Countries

To make clear, below is how i set up the lists and column, also as a confirmation to feed my confusion.

1. Created lists name Continents with column name Title

2. Created site column (from site settings-->site column) name Continent with lookup to Continents lists Title.

3. Created lists name Countries with column name Title and "Added from existing site columns" the column name Continents and renamed its column name to Continents Name

4. Created a site column Country with lookup to Countries lists Title.

I have a document library "Credentials" and "added from existing site columns" the site columns that i have created above Countinent and Country.

Then i pasted the code as shown below:

 

<script language="javascript" type="text/javascript" src="/SiteAssets/jQuery Libraries/jquery-1.7.2.min.js"></script>
<script language="javascript" type="text/javascript" src="/SiteAssets/jQuery Libraries/jquery.SPServices-0.7.1a.min.js"></script>
<script language="javascript" type="text/javascript" src="/SiteAssets/jQuery Libraries/jquery.SPServices-0.7.1a.js"></script>
<script language="javascript" type="text/javascript">

$(document).ready(function() {
    $().SPServices.SPCascadeDropdowns({
             relationshipList: "Countries",
             relationshipListParentColumn: "Continent",
             relationshipListChildColumn: "Title",
             relationshipListSortColumn: "Title",
             parentColumn: "Continent",
             childColumn: "Country",
             debug: true
});
});</script>
Again i highly appreciated Paul and kramden88 your comments.
 
Respectfully yours,
baguhanlangako
Apr 10, 2012 at 3:49 PM

You've made progress in the right direction. The problem that you're having now is that your parentColumn value does not precisely match the label of the drop down on the form. In your description above you mention the names "Continents", "Countinent" and "Continents Name". Check your form and see the exact label next to the drop down and make sure it matches the parameter in quotes for parentColumn.

Apr 10, 2012 at 4:29 PM
Edited Apr 10, 2012 at 4:32 PM

Thank you once again kramden88,

Thank you so much for the complement that i'm in the right direction in creating the lists and site column and added the site column to the lists i've created with lookup to the lists.

After investigation and looking closely on the form "credentials" document library it is "Continent". Please see illustration below:


Type Name Country Continent


i also tried to click on the column by going to Library-->Library Settings verify column name, please see below:

 

=%7B7972D248%2D07D4%2D4109%2D83C7%2D59D3534657CD%7D&Field=Continent

and Column name: Continent

and  

Get information from:

Continents

Below is an illustration of library settings for document library credentials listing all the column:

Columns

A column stores information about each document in the document library. The following columns are currently available in this document library:
Column (click to edit) Type Required
Title Single line of text  
Continent Lookup  
Country Lookup  
Created By Person or Group  
Modified By Person or Group  
Checked Out To Person or Group

 

Your big help is really appreciated. I've try to write one by one the lists and column i've created & added and try compare the documentation to see the relationship if i missed or ddn't see.

Once again thank you!

Respectfully yours,

baguhanlangako

Apr 10, 2012 at 7:13 PM

Hi there!

I was searching some answers on the discussion and i found a related issues that might work on my case. i'll try this and if something comes up i'll update the discussion.

Quote: " I had the CEWP on the Allitems.aspx page rather than the Newform.aspx...once I moved it to the Newform.aspx page with your trick "&ToolPaneView=2" I was mostly successful." - tomlynn Feb 24 2010 at 1:45 PM

Wiki Link: [discussion:155497]

Thank you so much!

Respectfully yours,

baguhanlangako

Apr 18, 2012 at 11:09 PM

Hi Guys,

Following the discussion: 155497 and all comments from Paul and Kramden88 i was able to run the SPcascadedropdown.

Thank you so much guys! This is really a cool tool!

Respectfully yours,

baguhanlangako

Jan 30, 2014 at 9:57 AM
Edited Jan 30, 2014 at 9:58 AM
I have had the same problem when we migrated from 2007 to 2010.

The problem was that the Parentcolumn was not found on the page, but I could clearly see it.
My dropdown box was a "required" one and I had to rename the Parentcolumn from "Project number" to "Project number Required Field".

On the page the name is still Project number, but it only worked when I added the "Required Field" addition to the name.

Hope this helps someone...

pMzQ,
Coordinator
Feb 4, 2014 at 3:11 PM
Can any of you try the latest alpha?
https://spservices.codeplex.com/releases/view/116626

It's got a fix for the " Required Field" issue with Office365. If anyone here has seen this issue in the wild with SharePoint 2010 and can post the markup, I'd appreciate it.

M.