Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
JavaScript
<script>
jQuery(function() {
	$("#itemname").autocomplete("AutoComp?mode=itemName");	
});
</script>

This function working fine.
But if I use that text box value it not pick full value, it takes only what are the text i entered.
I want full value of text in the text box which are generated by auto complete.

When I click text box that value will go to database and fetch different value and place that value in another text box.

Thank You.
Posted
Updated 22-Dec-13 17:46pm
v2
Comments
What have you tried for getting the TextBox value?

1 solution

you can try Ajax Auto complete, i have used this type. I hope this is use full to
ASP.NET
<asp:textbox id="Txt_location" runat="server" class="search_job2" value="Location" onfocus="if(this.value=='Location')this.value='';" onblur="if(this.value=='')this.value='Location';" xmlns:asp="#unknown"></asp:textbox>
                  <asp:autocompleteextender id="AutoCompleteExtender1" xmlns:asp="#unknown">
                          runat="server" DelimiterCharacters="" Enabled="True"
                          MinimumPrefixLength="1" ServiceMethod="City"
                          ServicePath="" TargetControlID="Txt_location"
                          UseContextKey="True">
                      </asp:autocompleteextender>


and code behind method is
C#
[WebMethod]

   public static string[] City(string prefixText, int count, string contextKey)
   {


       DataTable dt = new DataTable();
       dt = Bal_BindingData._job_category(prefixText);


       string[] movies = new string[dt.Rows.Count];

       for (int i = 0; i < dt.Rows.Count; i++)
       {

           movies[i] = dt.Rows[i]["Catagary_Name"].ToString();

       }



       return movies;


   }


for any query hit to reply
 
Share this answer
 

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