Extract validation into a separate file and prevent submission of error fields