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

Add custom messages for client-side validation #19

Open
erral opened this issue Jan 17, 2022 · 5 comments
Open

Add custom messages for client-side validation #19

erral opened this issue Jan 17, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@erral
Copy link
Member

erral commented Jan 17, 2022

The form delegates form validation of required fields and e-mail type fields to the browser, and the browser displays those messages in the browser-language. For instance, a browser configured in spanish in an english form will receive client-side validation messages in spanish. See::

image

Those client-side validation messages can be overridden using JavaScript, see this MDN page: https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_validation#implementing_a_customized_error_message

I don't know whether using such validation is feasible using those react widgets or some other thing can be done to translate those messages.

@erral erral added the enhancement New feature or request label Jan 17, 2022
@Anosh21
Copy link

Anosh21 commented Jan 24, 2022

@erral Hey Is anyone working on this issue?

@erral
Copy link
Member Author

erral commented Jan 25, 2022

Nope. How do you plan to implement this?

@Anosh21
Copy link

Anosh21 commented Jan 26, 2022

I have gone through the reference you have mentioned above and the solution is : setting the novalidate attribute on the form is what stops the form from showing its own error message bubbles, and allows us to instead display the custom error messages in the DOM in some manner of our own choosing.

@erral
Copy link
Member Author

erral commented Jan 27, 2022

go ahead with a PR if you want, I will be happy to review it

1 similar comment
@erral
Copy link
Member Author

erral commented Jan 27, 2022

go ahead with a PR if you want, I will be happy to review it

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

No branches or pull requests

2 participants