You can use this code for entire application, even if your page contains multiple forms and they have different IDs. Just put this code inside a common js file and include it in every page. $(function() { $("form").bind("keypress",...
More