If you want to use javascript, my suggestion is use html textbox, menas make it run at server. Now you can find lots of event. You can use control and event like this If you use master pages, Update panels etc the again, first check the name of the control from (view\source)in IE.
The miracle is this--the more we share, the more we have.