dropdown not found by function dropdownCtl(colName)

Jan 24, 2010 at 11:50 PM

I've tried to setup the example you give for the cascading dropdown menus, but it appears that your library can't find the dropdowns specified by their label.

When I trace through the javascript I see that in function dropdownCtl(colName) the control titled "Region" is not found. Below is the call I'm using and a couple of testing lines also

<script language="javascript" type="text/javascript" src="../jQuery/jquery-1.4.js"></script>
<script language="javascript" type="text/javascript" src="../jQuery/jquery.SPServices-0.4.8.js"></script>
	$(document).ready(function() {
			relationshipList: "Regions",
			relationshipListParentColumn: "Country",
			relationshipListChildColumn: "Title",
			parentColumn: "Country",
			childColumn: "Region",
			debug: true

$('select[title="Region"]').css('backgroundColor','#f0f'); //works

$().find("select:[Title='" + "Region" + "']")).html().css('backgroundColor','#f0f'); //similar syntax to function dropdownCtrl from jQuery.SPServices- doesn't work

The dropdown appears to be titled correctly in the HTML(see snippet below)
<TD valign="top" class="ms-formbody" width="400px">
  <!-- FieldName="Region"
  <span dir="none">
    <select name="ctl00$m$g_1dc7f282_468b_4457_a0f0_87862eb6a312$ctl00$ctl04$ctl02$ctl00$ctl00$ctl04$ctl00$Lookup" id="ctl00_m_g_1dc7f282_468b_4457_a0f0_87862eb6a312_ctl00_ctl04_ctl02_ctl00_ctl00_ctl04_ctl00_Lookup" title="Region">
      <option value="0">(None)</option>
      <option value="4">Eastern Provinces</option>
      <option value="3">Midwest</option>
      <option value="1">Northeast</option>
      <option value="6">Paris city limits</option>
      <option value="7">Paris Suburbs</option>
      <option value="2">Southeast</option>
      <option value="5">Western Provinces</option>


I am using the latest version of jQuery(1.4) - not sure if that matters. I'm also using MOSS 2007, and this page is a custom webpart page with a custom list form inserted into it.

Any suggestions?  Thanks!

Jan 24, 2010 at 11:56 PM

I'll have a new version in the next few days that is compatible with jQuery 1.4, but if you read through the documentation, the library is only tested with 1.3.2. In fact, there's an issue with some of the selectors in all versions, including the current v0.4.8, which you've spotted.  You can read what the issue is here.

Go with jQuery 1.3.2 for now, and watch this space for a v0.5.0 which will be compatible with 1.4.


Jan 25, 2010 at 1:14 PM

Wow, that was simple (for me).  Thanks so much.  I just assumed (!!!) that nothing would break moving to the latest jQuery. I should have checked that before posting.

This is a very cool method of accomplishing cascading dropdowns. I'll keep my eye out for updates to this very useful library!


Jan 25, 2010 at 3:27 PM

Sure thing. Glad you got it working.