I want a function to be run when a keypress occurs on a text box, so I have this code:
$(\"input[x]\").keypress(function() { DoX(); })
You can try to use the keyup event:
$(selector).keyup(function() { var textValue = $(this).val(); DoX(); });