Converting the complex dropdown to a simple dropdown using SPServices in SharePoint 2010


In this post we will discuss how to convert the complex dropdown to a simple dropdown using SPServices in SharePoint 2010.

Read some SharePoint tutorials
SharePoint online: Ultimate tutorial guide PDF download


How to attach workflows to content types in SharePoint 2010?



Cascading dropdownlist in SharePoint 2010 list using jQuery

The SPComplexToSimpleDropdown function lets you convert a “complex” dropdown rendered by SharePoint in a form to a “simple” dropdown. It can work in conjunction with SPCascadeDropdowns; call SPComplexToSimpleDropdown. SharePoint Lookup Column renders dropdowns differently in Internet Explorer depending on whether they have fewer than 20 options or 20+ options.
First it appears like below:


Converting the complex dropdown to a simple dropdown using SPServices in SharePoint 2010
Converting the complex dropdown to a simple dropdown using SPServices in SharePoint 2010
To convert to simple dropdown we have to write the jQuery code in the page.
Rather than opening the EditForm in a popup, open the form in a page (To open the item in a different page copy the item url and then paste it in a new browser), then edit the page and add a content editor web part.
In the content editor web part put the below code.
<script language=”javascript” src=”/_layouts/Server/NewScript/jquery.min.js”type=”text/javascript”></script>
<script language=”javascript” src=”/_layouts/Server/NewScript/jquery.SPServices-0.7.1a.min.js” type=”text/javascript”></script>
<script language=”javascript” type=”text/javascript”>
$(document).ready(function (){
  $().SPServices.SPComplexToSimpleDropdown({
            columnName: “City”
        });
    });</script>
Then save the page and then the complex dropdown will appear like below:
Converting the complex dropdown to a simple dropdown using SPServices in SharePoint 2010
Converting the complex dropdown to a simple dropdown using SPServices in SharePoint 2010
Summery:
In this Article We achieve if the parent list has more than 20 entries. SharePoint 2010 changes from a dropdown to an ajaxy-style ‘type ahead’-field.Using SPServices SPComplexToSimpleDropdown We convert into simple dropdown.
Check out Best Alternative to InfoPath -> Try Now

You May Also like the Following SharePoint Online Tutorials:

About Sagar Pardeshi

I am Developer working on Microsoft Technologies for the past 6+years. I am very much passionate about programming and my core skills are SharePoint, ASP.NET & C#,Jquery,Javascript,REST. I am running this blog to share my experience & learning with the community I am an MCP, MCTS .NET & Sharepoint 2010, MCPD Sharepoint 2010, and MCSD HTML 5,Sharepoint 2013 Core Solutions. I am currently working on Sharepoint 2010, MOSS 2007, Sharepoint 2013,Sharepoint 2013 App Dev, C#, ASP.NET, and SQL Server 2008.

View all posts by Sagar Pardeshi →