jquery keypress event firing a few times

The keydown event in combination with an html textbox will not be sufficient to prevent it from being fired multiple times. You can see this behavior in action on the jquery demo section of the keydown event: http://api.jquery.com/keydown/

One possible solution is to use the eventhandler "one" (see http://api.jquery.com/one/). Which ensures the event being handled only once:

jQuery("#createNewProduct").one("keydown", function (e) {
    //Do Stuff
});

This is correct behavior of the keypress event. The keypress event keeps firing as long as the key is down (like if you keep some char key pressed when in a textarea, the char is added that many times, this relates to keypress). For handle-once conditions, use either the key-down or key-up event depending on your requirement. Both key-up and key-down are fired just once. It goes like:

{Key-Down} {Key-Press} {Key-Press} ..(as long as key is down).. {Key-Press} {Key-Up}

http://api.jquery.com/keypress/

The keypress event is sent to an element when the browser registers keyboard input. This is similar to the keydown event, except in the case of key repeats. If the user presses and holds a key, a keydown event is triggered once, but separate keypress events are triggered for each inserted character. In addition, modifier keys (such as Shift) trigger keydown events but not keypress events.

Use keydown instead.