locked
Cascading Drop down Post Back issue! RRS feed

  • Question

  • Sharepoint Version: 2010

    Fields: Region/ Country

    I have successfully created a cascading drop down that the user can first select what Region they want to select and they it automatically shows them the Countries available only in that Region.  When I start clicking on each of the countries it keeps posting back to the server and makes checking multiple countries extremely time consuming especially if i am selecting multiple Regions because keeps taking me to the top of the list.

    I have tried to remove the filter on Country for REgion = Main.Region and then it works fine, but then there would be over 100 Countries to choose from.  Secondly, i created Region as a Choice instead of a lookup, but that had no affect. Thirdly, I set Browser Forms = Never and still no affect.  

    Any suggestions on any possible ways of fixing this?  

    Thursday, April 7, 2016 8:01 PM

Answers

All replies

  • Hi Superman man of steel,

    Could you please provide more about how you implement the cascading dropdown list in SharePoint for reproducing and resolving the issue?

    And provide the screenshots about your cascading dropdown list for understanding this issue.

    Here is an article about implementing the cascading drop using InfoPath step by step for your reference:

    https://basquang.wordpress.com/2010/03/29/cascading-drop-down-list-in-sharepoint-2010-using-infopath-2010/

    Best regards,

    Linda Zhang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Friday, April 8, 2016 6:39 AM
  • Hi

    I wonder how you create the cascading drop down?


    顺其自然地勇往直前!—Justin Liu

    Friday, April 8, 2016 6:48 AM
  • Hello Linda, In my cascading drop downs I have completed all of the exact steps you have in the link you provided.

    List - Region (Title)  

    List - Country (Title), Region (Lookup)

    Infopath - In my Country Properties, I added a new Country Data Source = Country1, updated my Entries field and set filter Region = Main.Region.  I changed Display Name to Country.

    Both Region and Country are multiple select values.  

    When I check one out of the 5 Regions, it properly displays those Countries within that Region, but the Problem is when I get Selecting the checkboxes for Country each time I check the boxes for Country it pauses and "Posts" back to the server and then refreshes the listbox back to the top of the list box instead of where I was last at.  By it doing this is making it extremely challenging to select over 100 countries in some of the Regions if I have to scroll down after each time I select a Country...

    The weird thing is as soon as I remove the Region = Main.Region filter it works fine in the sense that it allows me to select the Countries without going back to the top of the list, but then the problem becomes I see all 190 Countries in the world and I don't know which Country goes with which Region.


    Friday, April 8, 2016 3:09 PM
  • Hi Superman man of steel,

    Which browser are you using?

    When I test the cascading on multiple selection list boxes in Internet Explorer, it works fine. But when I try it in Chrome and Firefox, it backs to the top of the list box. I get the same results as you get.

    For resolving this issue, please use Internet Explorer instead.

    Best regards,

    Linda Zhang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Monday, April 11, 2016 9:59 AM
  • Hi Linda. I am also using IE version 11.  What version are you using?  Unfortunately my company controls which version of IE i am on.   If it works but on a newer version, than there isn't much I will be able to do about it because all of my peers would also be on the same version I am on....
    Monday, April 11, 2016 11:43 AM
  • Hi Superman man of steel,

    I tried it in IE 11, I got the same results as you got.

    A workaround, set up cascading using JQuery instead of using InfoPath form.

    1. Add a Content Editor web part to the NewForm.aspx page.

    2. Click the Content Editor and click Edit Html Source.

    3. Type the code such as below.

    Note: You need to make some changes to meet your lists.

    <script src="https://code.jquery.com/jquery-1.10.2.js" type="text/javascript"></script>
    
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/2014.02/jquery.SPServices-2014.02.min.js" type="text/javascript"></script>
    
    <script type="text/javascript">
    
      $(document).ready(function() {  
    
                $().SPServices.SPCascadeDropdowns({ 
    
                    relationshipList: "ListB",  
       
                    relationshipListParentColumn: "listA",  
       
                    relationshipListChildColumn: "Title",
       
                    parentColumn: "listA",  
       
                    childColumn: "listB",  
       
                    promptText: "Choose...",  
       
                    debug: true 
       
                });  
      
    });  
    
    </script>

    Here is a demo in detail for your reference:

    http://spservices.codeplex.com/wikipage?title=$().SPServices.SPCascadeDropdowns&referringTitle=Documentation

    Best regards,

    Linda Zhang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Tuesday, April 12, 2016 10:58 AM
  • Hi Superman man of steel,

    Is there any update?

    Have you solved the issue?

    If the reply helps you, please mark it as answer. It will be beneficial to others in this forum who meet the same issue in the future.

    Best regards,

    Linda Zhang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Tuesday, April 19, 2016 10:12 AM
  • Hello Linda,

    I have tried to use JQuery code once before and couldn't fully figure out how to get the code to work.  I am not sure if it is something related to my companies permissions and IE settings or if I wasn't setting it update correctly.  I put my JQuery.min.js in the style library/Scripts folder and tried to reference it and it never did anything.  Do you have any suggestions on how to get the JQuery to work as well as which files I need to put into this file to be exact? 

    Thanks,
    Matthew

    Tuesday, April 19, 2016 11:26 PM
  • Hi Matthew,

    Copy all scripts in the jquery.js file or download the js file from the site, then upload the file to the library in SharePoint.

    Using the following script to call the file, change the path of the JQuery with your path. Note: You should be pay attention to the punctuation.

    <script src="http://sp/sites/team/Shared%20Documents/jquery-1.10.2.js"></script>

    We can use F12 Developer Tools to debug your web pages.

    More information, please refer:

    https://msdn.microsoft.com/en-us/library/gg589507(v=vs.85).aspx

    Best regards,

    Linda Zhang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Wednesday, April 20, 2016 10:13 AM
  • Linda,

    I have 3 lists set up:

    lkp_Region:  (Parent)

    Region (Title)

    lkp_Country:  (Child)

    Region (LOokup Field: lkp_Region.ID)

    Country (Title)

    Test_Country:

    Test Name (Title)

    Country (Lookup Field: lkp_Country.ID)

    Region (Lookup Field: lkp_Region.ID)

    Using the code I updated this:

    <script src="/sites/[site]/Style%20Library/Scripts/jquery-1.12.3.min.js" type="text/javascript"></script>
    
    <script type="text/javascript">
    
      $(document).ready(function() {  
    
                $().SPServices.SPCascadeDropdowns({ 
    
                    relationshipList: "lkp_Country",  
       
                    relationshipListParentColumn: "Region",  
       
                    relationshipListChildColumn: "Title",
       
                    parentColumn: "Region",  
       
                    childColumn: "Country",  
       
                   
       
                    debug: true 
       
                });  
      
    });  
    
    </script>

    Based on my lists/Columns, am I entering this in correctly?   Because the page doesn't do anything.  I want it to display only those Countries when I select a Region. 

    Also, since I am using the ID column it shows up as Numbers instead of the Title from Lkp_Region or Lkp_Country, Is there a way of having Jquery display the Title instead of the ID?? or should I be using Title column for my lookups in Test_Country?

    THanks for all your help!!

    Wednesday, April 20, 2016 12:52 PM
  • Hi superman man of steel,

    You need to use the Title field instead of the ID.

    About how to use JavaScript to create cascaded lookup dropdown in the SharePoint form, here are three articles for your reference:

    http://spservices.codeplex.com/wikipage?title=$().SPServices.SPCascadeDropdowns&referringTitle=Documentation

    https://spcd.codeplex.com/

    http://www.sharepointboris.net/js/spcd/

    Best regards,

    Linda Zhang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Friday, April 22, 2016 11:59 AM
  • Thanks LInda for all your guidance.  I found a website that worked perfectly now using JQuery and step to step instructions on how to get it to work.

    http://www.sharepointbinder.com/1/post/2012/09/sharepoint-cascading-filtering-dropdowns-using-jquery.html

    I think the biggest help in this article is how to implement the js code using the Content Editor.  Very Helpful!!
    Monday, April 25, 2016 12:32 PM