Hi Rahul,
If you are using server control then it might help you ;)
<asp:TextBox onkeypress="javascript:alert('call a javascript function dear ');" runat="server" ID="txtid"></asp:TextBox>
Let me know if this satisfy your purpose or not.
we will find some other solution 2gther ;)
Classic ajax can also help :)
:) Enjoy life
(Sachin Dabas)