Unify form submission event handlers

Let's have just one function that handles the submission validation