I have searched for an answer but couldn\'t find one!
I have a simple form,
The correct event is onSubmit() and it should be attached to the form. Although I think it's possible to use onClick, but onSubmit is the correct one.