Click here to Skip to main content
15,885,869 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi guys I have following jquery:


<script type="text/javascript">
$(document).ready(function () {
SearchText();
});
function SearchText() {
$(".csSearch").autocomplete({
source: function (request, response) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "WebService.asmx/GetCountries",
data: "{'prefixText':'" + $('.csSearch')[0].value + "','Flag':'" + $('.cslbl')[0].innerHTML + "','val':'" + $('.csdrpsrc')[0].value + "'}",
dataType: "json",
success: function (data) {
response(data.d);
},
error: function (result) {
alert("Error.....");
}
});
}
});
}
</script>
I have used it for auto-complete textbox but now I want to return those results to div to apply proper CSS effect to it.
I have this simple div:



Thanks in advance.
Posted
Updated 11-Jul-14 23:14pm
v2

1 solution

You have written all codes inside autocomplete event. No, just do a Ajax call and inside the success event of Ajax block, assign the results to the div.
 
Share this answer
 
Comments
Mitul Birla 12-Jul-14 6:19am    
thanks for reply Tadit Dash.
But I used following code inside success event:

var content = $(data).find("#content");
$("#divdisplay").append(content);

Now it dosen't display even the results.
what is wrong in above code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900