Multiple Cascade Dropdowns incorrectly update list items

Coordinator
Apr 18, 2013 at 3:48 PM
Originally posted as an item in the Issue Tracker by tonydixon

I have a page with three dropdowns, Account, Contact and Location. When a user selects an account the contact and location list are updated to only show items already linked to the selected account (so only contacts for the selected account are shown). These combos are used to create a new list item.

In IE9 when I select an account the contact and location are correctly updated. However when the form is submitted the same id is submitted for both the account and contact. For example, if I choose contact Joe Bloggs with id 450, and Location London with id 32, when the form is submitted the querystring shows the contact field with an id of 450, and the location field with an id of 450. These are then added to the newly created list item, so the contact is correct, but the location id will either not be recognised or point to the wrong location (if this location happens to have the same id as the contact).

This behaviour is not seen when the SPCascadeDropdowns are used (the ids are associated correctly). The behaviour is also not seen in Firefox 18.


I am using SPServices-0.7.2.min.js and JQuery 1.7. The dropdowns appear in sequence in the page, and the jquery SPCascadeDropdowns functions are run consecutively onready.
Apr 19, 2013 at 12:15 PM
Hi,

I've found this problem. I'm confident my list structure is ok, as when I use Firefox the item is correctly posted, and the links are correct. It seems to be a problem in IE?

The calling structure and list structure is shown below.
 $(document).ready(function() {     
            
            // Set up the cascade from Account to Client contact
            $().SPServices.SPCascadeDropdowns({
                relationshipList: "Contacts_sync",
                relationshipListParentColumn: "Account",
                relationshipListChildColumn: "FullName",
                parentColumn: "Account",
                childColumn: "Contact",
                listName: "Meetings and Calls",
                simpleChild: true
                
            });     
            
            $().SPServices.SPCascadeDropdowns({
                relationshipList: "Site Locations",
                relationshipListParentColumn: "Account",
                relationshipListChildColumn: "Title",
                parentColumn: "Account",
                childColumn: "Location",
                listName: "Meetings and Calls",
                simpleChild: true
            });     

        });
Thanks,

Tony
Coordinator
Apr 20, 2013 at 4:08 PM
Ok, looking at your code helps. I'm wondering if the simpleChild option is causing the problem. Can you try the same code, but without the simpleChild option in both cases?

You've got two child columns depending on the same parent, which is somewhat unusual, but that the SPCascadeDropdowns function should support.

The reason that you may not be seeing problems in Firefox is that SharePoint only uses the complex dropdowns in IE, not in any other browser. I'm not sure what you mean by "This behaviour is not seen when the SPCascadeDropdowns are used".

M.