This repository was archived by the owner on Dec 26, 2025. It is now read-only.
Repository navigation
Anonymous ValidationMessages #78
Unanswered
Chris-Mingay
asked this question in
Q&A
Replies: 2 comments
|
Hi Chris, I don't think this is possible with Blazor's forms and validation system as-is. I think the key part is the Validation Store, it holds a key which corresponds to a property on the form model and a list of errors for that key. The issue with what you're attempting is that there would be an error but it wouldn't belong to anything. |
0 replies
|
Cheers Chris, I guess that's what I am after then really, being able to filter out the messages that don't belong to anything and show them at the start. I guess that might be possible somewhere? Either way I think this falls under an |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This is a crude example but:
The first rule is specific to a field of a command (Title) so in the front end I show this by using
<ValidationMessage For="() => Command.Title" />The second rule is NOT specific to a field so I would like to display it at the top of the form, is there a way to do this?
Initial thoughts were I could do something like
<ValidationMessage For="() => Command" />because it matches the Expression of the rule. That didn't work.My second thought was to use
<ValidationSummary/>however, this shows all of the errors, I just want to show "unlinked" errors at the top of the form.Any ideas?
Thanks again
Chris
All reactions