Skip to content

[Form] client vs server validation is inconsistent in default config #5365

@Tobion

Description

@Tobion

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy