-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Labels
Description
In its default configuration of a form type without options and without constraints, the client-side vs. servers-side validation is inconsistent.
That's because the default for the required
option is true. So on the client the field is required, but on the server not.
So IMO the default for required should be false because
- it will fix the client <> server mismatch
- such extra functionality like HTML5 validation should be opt-in and not opt-out.
That's of course a BC break, but remember this is only about the client-side required="required" HTML5 attribute and does not influence the server validation.
Also remember, when using the type guesser in forms (type = null), the required option is correctly guessed based on the constraints. But most of the time users will explicitely set the form type, resulting in this inconsistency.