Why is the form submitted without the required fields being filled out?