I have created one Custom List in sharepoint 2010 as mentioned below:


Title        TeamName

A             cc

b             ddd

c             eee

I have created html table in the Content Editor webpart of sharepoint 2010 with one rows and two columns such as:

Name:        Teamnamedropdown

In Teamname is a html dropdown. I need to bind the values from sharepoint list A of the Column(TeamName) to the TeamNamedropdown. My output should in dropdown. Only using Javascript or ECMAscript i need to achieve this requirement.

3 Answers 3


Here is my solution

<select id="input2" style="width:30%"><option>Any</option></select>

<script type="text/javascript" language="javascript">
     $(document).ready(function () {
         var soapEnv =
"<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
<soapenv:Body> \
<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
<listName>as</listName> \
<viewFields> \
<ViewFields> \
<FieldRef Name='TeamName' /> \
</ViewFields> \
</viewFields> \
</GetListItems> \
</soapenv:Body> \
             url: "lists.asmx",
             type: "POST",
             dataType: "xml",
             data: soapEnv,
             complete: processResult,
             contentType: "text/xml; charset=\"utf-8\""

   var select = $('#input2');

     function processResult(xData, status) {
         $(xData.responseXML).find("z\\:row").each(function () {
             select.append("<option>" + $(this).attr("ows_TeamName") + "</option>");     



Please replace the list name and column name(ows_yourcolumname)


The easiest way to meet your requirement would probably be using SharePoint's web services to populate the drop down. Check out spservices: http://spservices.codeplex.com/


Here there is demonstrate nicely how to retrieve and bind list data to dropdowm list.


check out fillDropDown() function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.