<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>
<script>
$(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>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 = domElementArray.map(function()
{
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
});
}
});//.ajax
});//docReady
</script>
<input type="text" id="Name" Class="autogool" style="width: 190px"/>