Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

templates: allow displaying dynamic error message on forms created via Form Builder plugin #11275

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Tajmirul
Copy link

@Tajmirul Tajmirul commented Feb 19, 2025

Close #11274

Why this PR?

I've created a custom phone number input block for my form builder, including validation. However, the component on the frontend only displays the generic message "This field is required," even when formState.errors contains specific error messages. This is not the expected behavior. I need the component to display the error messages from formState.errors.

Description

This pull request includes changes to improve error handling in various form components by passing the name prop to the Error component and updating the Error component to display specific error messages.

Error handling improvements:

Form component updates:

@Tajmirul Tajmirul changed the title fix(form-builder): Dynamic error message for form builder input fix(plugin-form-builder): Dynamic error message for form builder input Feb 19, 2025
@Tajmirul Tajmirul changed the title fix(plugin-form-builder): Dynamic error message for form builder input fix(plugin-form-builder): dynamic error message for form builder input Feb 19, 2025
@paulpopus paulpopus changed the title fix(plugin-form-builder): dynamic error message for form builder input templates: allow displaying dynamic error message on forms created via Form Builder plugin Feb 19, 2025
@paulpopus
Copy link
Contributor

Hey, thanks for your PR, can you give me a config I can test this with please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error message is fixed "This field is required" in form builder
2 participants