Check so the form is valid before posting