Skip to content

How to change validation css class names on server side #128

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

Closed
lonix1 opened this issue Oct 22, 2024 · 3 comments
Closed

How to change validation css class names on server side #128

lonix1 opened this issue Oct 22, 2024 · 3 comments

Comments

@lonix1
Copy link
Contributor

lonix1 commented Oct 22, 2024

Hi guys. When I updated the css class name customisation docs, I didn't take into account server-rendered pages which already contain errors.

For example: form submission fails due to validation errors, so page is rerendered, but with ASP.NET Core's css class names (input-validation-error and input-validation-valid). Those are incorrect in my case, as I'm using bootstrap (so I need is-invalid and is-valid). I assume the same problem exists for those using tailwind, etc.

I'd like to change those css class names so they match what is used by this library.

Although it's not an issue with this library, it's nonetheless related. Does anyone have a server-side customisation technique for this?

(Once I find a solution, I'll also update the docs.)

@lonix1
Copy link
Contributor Author

lonix1 commented Oct 22, 2024

I just discovered that the framework uses hardcoded values for those css classes. So I don't think this is currently possible.

I posted a feature request for a customisation hook during startup.

To future readers: please upvote that issue.

@lonix1 lonix1 closed this as completed Oct 22, 2024
@dahlbyk
Copy link
Collaborator

dahlbyk commented Oct 22, 2024

Older issues were linked in #86 (comment):

In particular: dotnet/aspnetcore#8573 (comment)

@lonix1
Copy link
Contributor Author

lonix1 commented Oct 23, 2024

That is one big LOL given that I already asked that question and you already answered it. Do you ever find that years go by and you encounter the same problem, search for the same solutions, and discover one written by you on StackOverflow or GitHub or whatever? 😆

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