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

Input fields validation result error message should match application language #87

Closed
dlavrenuek opened this issue Dec 14, 2021 · 3 comments

Comments

@dlavrenuek
Copy link
Contributor

At the moment the validation messages f.e. for a <CmTextfield required /> will match the user's browser language even if it is not supported by the application. This is especially disturbing when backend validation is used resulting in some error messages being in a wrong language. The only option right now to have consistent behavior is not to use common-ui validation at all.

Example common ui validation
Bildschirmfoto 2021-12-14 um 16 12 30

Example application specific error message
Bildschirmfoto 2021-12-14 um 16 12 50

@alexandertrefz
Copy link
Contributor

alexandertrefz commented Dec 20, 2021

This is browser level behaviour. If you want to opt out of the browser validation, you can do so by using the ignoreDefaultValidation property on the validation object. That turns off all default validation, and with it, all browser level error messages as they are created by said validation.

This is to be cautioned against, as this likely creates inconsistent error messages (for example for required fields), as well as opening yourself up to many implementation mistakes in the validation itself, as you then have to handle required, etc yourself.

@dlavrenuek
Copy link
Contributor Author

Thank you for the hint with ignoreDefaultValidation

as well as opening yourself up to many implementation mistakes in the validation itself, as you then have to handle required, etc yourself.

I can not imagine that any of the Camunda applications rely only on client side validation, so we can assume that the validation will always be correctly implemented.

@alexandertrefz
Copy link
Contributor

Server side validation is merely a safety backup, to the user, a client side validation that says that the form is ok while it isnt, with the server then throwing back an error is just as bad of an issue to the user as no client side validation at all. I doubt that there are many forms that are using the feedback from the server for anything except a "something went wrong, try again" screen, in practice, because in practice anything more is rarely relevant. But the workaround option is there for a reason, so feel free to use it.

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

No branches or pull requests

2 participants