8000 [Form] Improve default form error messages · Issue #5946 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Form] Improve default form error messages #5946
Closed
@webmozart

Description

@webmozart

I think that in order to provide a better user experience, we should improve the error messages shipped with the Form component by default. I am not talking about the error messages in the Validator component.

If I use the Validator component stand-alone, getting an error such as "This value is not a valid number" is fine. If I use the Form component, displaying that message for a form field is a bit awkward. Even worse are the tons of "This value is invalid" messages.

I suggest to

  1. Set sensible defaults for the "invalid_message" options in all core types. These defaults should be user friendly, such as "Please enter a valid email address." (or better, if you have suggestions)
  2. Duplicate the error messages of the Validator component into the Form component and change the translations to be more user friendly (in the web form context, again, such as "Please enter a valid number" or better). This will mean a bit more maintenance work, but much better UX.

Opinions? How would you ideally like the error messages to be when you submit an erroneous field?

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementFormGood first issueIdeal for your first contribution! (some Symfony experience may be required)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0