2

I have created a keyboard using asp:button control. Onclientclick event it will display the corresponding text on the textbox. All these are working fine.

Needs:

  1. I want to add autocomplete using jquery to a textbox. if i click the button [A] it has to display all the records with a.

  2. This process is working if im using the system keyboard.

Code:

      <link href="CSS/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
      <script type="text/javascript" src="js/jquery.autocomplete.js"></script>  

      $("#antSearchText").autocomplete('SearchAutoComplete.ashx');

     <asp:Button ID="six" runat="server" Text="6" CssClass="myclass" OnClientClick="return typeLetter(this);" />

Geetha.

4 Answers 4

1

The documentation here explains how to activate autocomplete on a textbox: JQuery Autocomplete. Have you tried that, and it still doesn't work?

Otherwise, can you add more information? What makes the 'system keyboard' work? What does the typeletter function do?

Sign up to request clarification or add additional context in comments.

Comments

1

Thank You for all your replies. My problem resolved by using the following code to fire the event.

Code:

   var q = document.getElementById('txtbox');
   var evObj = document.createEventObject();
   evObj.keyCode = 84; // [T] key
   q.fireEvent('onkeydown', evObj);

Geetha.

Comments

0

You should return false at the end of client click event and do the textbox manipulation in typeletter function. It should look like OnClientClick="typeLetter(this);return false;"

This stops the asp:button from posting back

Comments

0

The problem is the plugin, by default uses the onKeyUp event (probably) which is why the system keybord would work. The API doese provide a call to trigger the search

http://docs.jquery.com/Plugins/Autocomplete/search

I didn't see any thing like $(this).search() or $('input#suggest').search(); in your function. I could have missed it though

You can probably now ignore the following!

OLD ANSWER BELOW

Try using a standard HTML button instead of an ASP:net button, if there is no other reason to use an ASP:net button control that is.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.