I am using the below jquery code to call a ajax function in my contorller CS. Search is the function name. How ever the function is called in the controller. But i am supposed to get a value in the text box of the page inside this function. Basically this is for the auto complete feature. on key up the function is called. But i am not able to get the value in the textbox to do a relavent search. please reply back anything you feel would be helpful to me. Thanks in advance.
$(document).ready(function(){
$("#searchusers").autocomplete("http://localhost/CS/index.php/search" , {
width: 500,
selectFirst: false
});
});
$(document).ready(function(){
$("#searchusers").result(function(event, data, formatted) {
if (data)
$(this).parent().next().find("input").val(data[1]);
});
$('#set1 *').tooltip();
$('#firstname').tooltip();
});