Only validate the form if posted