0

I have an asp:TextBox with AutoCompleteExtender attached. This is my code

txtSearch.Attributes.Add("OnKeyPress", "ProcessKeyPressed()")

function ProcessKeyPressed()
  { 
    if(event.keyCode == 13)
      {
        Search()
      }
  }

The function Search() gets called when the user types in a word and presses enter.However, the enter key is not detected when the user hits the tab key to select one of the auto complete suggestions...Any ideas how I can fix this?

Many thanks,

coder
  • 1,980
  • 3
  • 21
  • 32
user1839862
  • 13
  • 1
  • 4

1 Answers1

0

You can add this code for

if(event.keyCode == 13 && e.keyCode == 9) //9 For Tab
{
   ....
}

LInk : http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes

iphonic
  • 12,615
  • 7
  • 60
  • 107
Aghilas Yakoub
  • 28,516
  • 5
  • 46
  • 51