create Autocomplete Text box of sharepoint list using jquery

Posted by Sagarp under Others category on | Points: 40 | Views : 6969
<link href="/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> 

<script src="/libs/jquery/1.4/jquery.min.js"></script>

<script src="/libs/jqueryui/1.8/jquery-ui.min.js"></script>



{ var soapEnv = "<soapenv:Envelope xmlns:soapenv=''><soapenv:Body> <GetListItems xmlns=''><listName>User Information List</listName><viewFields><ViewFields><FieldRef Name='LastName0' /> </ViewFields></viewFields> </GetListItems> </soapenv:Body> </soapenv:Envelope>"; //Make a call to the List WebService using the SOAP envelope described above. //The URL is fixed to a Specific Site Root. Feel free to change this //to your own fixed root or do some jscript voodoo to figure out where //Of course in 2010 you can do this with the Client Object Model, or hit //the list rest Service and return json, so enabling jsonp cross site calls.

$.ajax({ url: "/_vti_bin/lists.asmx",

type: "POST",

dataType: "xml",

data: soapEnv,

contentType: "text/xml; charset=\"utf-8\"",

success: function( xmlResponse ) {

var domElementArray=$( "z\\:row", xmlResponse );

var dataMap =


return {

value: $(this).attr('ows_LastName0') ,

id: $(this).attr('ows_LastName0')



var data = dataMap.get();

//Find the Sharepoint Portal Search Box (this is a poor selector, but it is not properly named by sharepoint, well it is but INamingContainer getrs in the way)

$("input. autogool ").autocomplete(

{ source: data






<input type="text" id="Name" Class="autogool" style="width: 190px"/>

Comments or Responses

Login to post response