onSubmit for keypress