I'm trying to add validation to some forms using the Radzen Components for Blazor. While they do validate properly, like a standard InputText, it only does so upon trying to submit. For example, if I've set the field to be required, I can get it to show a validation-message but the message won't go away when I put text into the field, only when I try to submit again.
This is a basic example for a Login-form.
<EditForm Model="viewModel" OnValidSubmit="LoginAsync" FluentValidationValidator / <InputText @bind-Value="viewModel.Username" /> <ValidationMessage For="@(() => viewModel.Username)" /> <RadzenPassword @bind-Value="viewModel.Password" /> <ValidationMessage For="@(() => viewModel.Password)" /> <button type="submit">Login</button> </EditForm>
Here, both fields are required and both will show the error message when trying to submit. However, only the username will have its warning message go away upon entering text into the field.
Is there something I'm missing? I noticed that there are some Validators within the package, perhaps these are required together with the other Radzen components? If that's the case, does anyone care to show how I could add, say, the RadzenRequiredValidator to this basic example?
Edit: Had to remove the tags around EditForm for these to show, so that it's easier to read for others.