Skip to content

Forms: allow previewing and modifying validation errors #41142

Description

@simison

I used the block settings to change the color of the text to a different color, but you can’t change the error text color without css.

Image

It'll probably make sense to have some mechanism to allow previewing fields in error state, and then have typography+color controls for them separately.

Internal ref p1737033540877189-slack-C0197R4UB4J

Activity

  1. added
    [Block] FormForm block (also see Form package label)
    [Feature] Forms BlocksBlocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc.
    on Jan 16, 2025
  2. github-actions commented on Jan 16, 2025

    @github-actions
    Contributor

    This issue could use some more labels, to help prioritize and categorize our work. Could you please add at least a [Type], a [Feature], and a [Pri] label?

  3. simison commented on Jan 28, 2025

    @simison
    MemberAuthor

    One idea from Gutenberg forms experimentation:

    Image Image
  4. added
    EnhancementChanges to an existing feature — removing, adding, or changing parts of it
    on Feb 7, 2025
  5. talldan commented on Feb 21, 2025

    @talldan
    Contributor

    Just to link the two things together, this also came up when trying to enable more layouts for forms. (#41805 (comment))

    It seems the main validation message is auto-inserted before the submit button, so if you were able to move the button into say a row block, that would result in the validation message being awkwardly placed and cause issues with the layout:
    Image

    Turning the validation message into a block would be cool. The form perhaps doesn't need to have this by default (the message could be rendered as it is now when the block is not present, perhaps via the block hooks feature), but when added it could allow custom positioning of the messages and further customization.

  6. simison commented on Feb 24, 2025

    @simison
    MemberAuthor

    Not directly applicable but Woo's notices convo is interesting to check in case ideas come up.

  7. simison commented on Feb 24, 2025

    @simison
    MemberAuthor

    perhaps via the block hooks feature), but when added it could allow custom positioning of the messages and further customization.

    Mandatory child blocks feels more fitting as block hooks are something you can toggle off.

    The whole validation UX needs attention as we should rely much more to inline validation errors directly in the fields, not a separate area as much.

    Thus separate UX for "success" and "validation errors" might make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementChanges to an existing feature — removing, adding, or changing parts of it[Block] FormForm block (also see Form package label)[Feature] Forms[Feature] Forms BlocksBlocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc.[Package] Forms

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions