I am fairly new to SharePoint, but have used the jQuery library in other environments.
I'm trying to set up a cascading dropdown inside a subsite, using lists from the top level site. I've gone through many of the posts here, but can't get it working in my site collection. I keep getting a server 500 error related to _vti_bin/Lists.asmx. I've
tried using the SPCascadeDropdowns function and the SPFilterDropdown.
The scenario is that in the top level site, I have a list "MainCat" for main categories. I have another list "SubCat" that has a title column and then a lookup to the MainCat list to create a relationship to sub categories. Both lists use
"Title" for the primary column. In the SubCat list, there is a column "MainCat".
In the subsite, I have a list in which I would like the cascading dropdown list based on the SubCat list from the top level site.
Using the SPFilterDropdown function, my code is:
alert("jQuery is here");
var field = $("nobr:contains('MainCat')").closest("tr");
var itemMain = $(field).find("select");
//var mainCtgy = $( "itemMain option:selected").text();
var topCtgy = $(mainCtgy).val(); // get the main category that was selected
var mainTxt = $(mainCtgy).find('option:selected').text();
var myQuery = "<Eq><FieldRef Name='MainCat' /><Value Type='Choice'>"+mainTxt+"</Value></Eq>";
alert("Got to function");
alert("value is: " + topCtgy);
alert("text is: " + mainTxt);
alert("caml is: " + myQuery);
The alerts are all coming through; the subcat dropdown does not filter though.
Any help would be most appreciated!