Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have few textboxes i need the values only in autocomplete.If a user selects from autocomplete & enters a text the autocomplete should trigger again. Can someone help me with the code please.

http://www.apsrtconline.in/oprs-web/[^]

I need the functionality as in the link...




$(function () {

$('#<%= txtCompany.ClientID %>').autocomplete({
source: function (request, response) {
$.ajax({
url: "WebService.asmx/GetCompanyNames",
data: "{ 'companyName': '" + request.term + "' }",
type: "POST",
dataType: "json",
contentType: "application/json;charset=utf-8",
success: function (result) {
response(result.d);
},
error: function (result) {
alert('There is a problem processing your request');
}
});
},
minLength: 0
});
Posted
Updated 23-Feb-14 23:25pm
v2

Possible, but make no sense and would lead to confusing UI. It simply means your control should not be a text box. It should be a combo box.

—SA
 
Share this answer
 
Comments
Abhinav S 24-Feb-14 3:16am    
A textbox can be an autocomplete box too though.
Sergey Alexandrovich Kryukov 24-Feb-14 3:20am    
Yes, of course. But not with condition "only autocomplete values allowed", which renders such control useless, as a text box.
—SA
Abhinav S 24-Feb-14 3:22am    
Of course. That is why they have drop downs. :)
Abhinav S 24-Feb-14 3:17am    
Agreed in principle. A 5.
Sergey Alexandrovich Kryukov 24-Feb-14 3:20am    
Thank you, Abhinav.
—SA
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 24-Feb-14 3:11am    
Don't you see that his is just a wring idea? Please see my answer.
—SA
Abhinav S 24-Feb-14 3:16am    
Yes read your comment and replied.
Challa92 24-Feb-14 5:29am    
http://www.apsrtconline.in/oprs-web/ i need output like the one in the link

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