AutoComplete TextBox using JQuery in SharePoint 2010 with SPList values
To achieve this, we have to use SPServices. Get the script from below link:
jquery.SPServices-0.6.2.min.js
var availableTags = GetListItems();
Add the below function inside the wireEvents() function
///function to get list items using spservice
function GetListItems()
{
var name = new Array();
var index = 0;
$().SPServices
({
operation: "GetListItems",
async: false,
listName: "Keyword Master",
CAMLQuery: "<Query><OrderBy><FieldRef Name='Title' Ascending='True' /></OrderBy></Query>",
CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
completefunc: function (xData, Status) {
$(xData.responseXML).find("z\\:row,row").each(function () {
name[index] = $(this).attr("ows_Title");
index++;
});
}
});
return name;
}
Output:
Done. here we get the values from SharePoint 2010 list.
Thanks for this Tutorial..!!
ReplyDelete