Use the submit event instead of the keypress event