10

I have asp.net TextBox with ontextchanged event this is search text box in my application.

I have search code in this event. how can I fire this event with the help of j query onkeyup.

If i enter text in text box it will fire ontextchanged without press enter or mouse.

This is an example of event what i need. But i dont know how to fire ontextchanged on this.

http://viralpatel.net/blogs/demo/sum-textbox-value-javascript.html

Shrikant Soni
  • 2,337
  • 2
  • 30
  • 35
Pankaj Mishra
  • 20,197
  • 16
  • 66
  • 103

1 Answers1

16
$('#textMessage').keyup(function(event) {
  if (event.keyCode == 13) {
    var message =  $('#textMessage').val();
    alert(message);
  } else {
    return true;
  }
}); //endTextMessage keyup
Jhonny D. Cano -Leftware-
  • 17,663
  • 14
  • 81
  • 103
h3n
  • 5,142
  • 9
  • 46
  • 76