Introduction
Autosuggest using jQuery
Background
For using jQuery autosuggest we need the js file "jquery.ui.autocomplete.autoSelect.js". Refer this link for download and help http://docs.jquery.com/UI/Autocomplete.
Using the code
Once you have added the aotoselect.js for a textbox you will get a property named autocomplete
Add a textbox on which yo wish to apply autosuggest and write the script. My function "GetAllSearchProducts" is getting all the products beginning with the letter typed in the textbox named "searchproduct" .
<div>
<input name="" type="text" class="txtF ui-autocomplete-input" id="searchproduct"
align="absmiddle" /><input name="" type="button" class="btimg" align="absmiddle"
onclick="SearchProduct();" /></div>
<script type="text/javascript">
$(function () {
$("#searchproduct").autocomplete({
source: function (request, response) {
$.ajax({
url: "../Common/GetAllSearchProducts",
data: "{ 'name': '" + request.term + "' }",
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
dataFilter: function (data) { return data; },

Join the conversation! Your thoughts help the community grow.