Creating forms in HTML has always been complicated. You first need to write the correct markup, then you need to make sure each field has a valid value before submitting, and finally you need to inform the user when there is a problem.
https://webkit.org/blog/7099/html-interactive-form-validation/