5.1.1 Just hit enter!

Sometimes you want the user to just be able to hit return (enter) after they type something in an input box.  You can assign what are called “keyboard shortcuts” using jQuery to specific functions.  For example, you can set it up so that when a user clicks the “enter” button, which has a numeric code “13”, to trigger a specific function.  Add the following code to the initialize function:

Here is a list of valid keypress codes.

(sample code)

Leave a Reply