Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 24th, 2012  |  syntax: None  |  size: 0.47 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. textbox browser autocompletion options do not fire keypress/keyup
  2. <form name = "myform" method = "post">
  3.     <input type = "text" name = "mytext" id = "text_id"/>
  4.     <input type = "submit"/>
  5. </form>
  6. <script>
  7. $(document).ready(function() {
  8.     $('#text_id').bind('keyup', function() {
  9.         console.log('pressed!');
  10.     });
  11. });
  12. </script>​
  13.        
  14. $('#text_id').on('keyup change', function () {
  15.     // Code that works well for both cases, since they are
  16.     // a bit different.
  17. })