required to the input fields, and change
the email field to type="email", you can skip custom validation
and just use the browser's built-in validation.
However, it should be noted that this doesn't always align well with the design, but it's at least an option.