onKeyEvent 'Escape' key submitting form

Corrected problem in function onKeyEvent when pressing escape key