Is there a way to make HTML5 check all fields at once, and not one at a time?
Using multiple JavaScript lines is fine, but I really don't want to use the whole module for this.
I searched quite a lot, but could not find a clean solution for this.
Here is an example form:
<html> <head> <title>Validation Test</title> <link href="css/style.css" rel="stylesheet"> </head> <body> <form action="" id="myForm" method="post"> <input id="name" name="name" required type="text"> <input id="phone" name="phone" required type="text"> <input type="submit" value="Submit"> </form> </body> </html>
Css file:
input:focus:required:invalid { border: 2px solid red !important; }
The message proposed as a possible duplicate is that there are several validation conditions for one field, I want to check / show all invalid fields at the same time.
css html5 validation
Mankind1023
source share