Prototype provides an excellent abstraction mechanism for event handling in javascript. I needed to capture when a user hit the ‘return key’ inside a text box, and then perform a specified action. Using the observe function and the KEY_RETURN constant, you can easily detect when this is done.
Simply place the following [...]