I tried to use GreaterThen validator and it looks like it doesn\'t support client-side validation. Is there a list of FluentValidation validators which support client-side v
You can use Form Helper. It adds client-side support to Fluent-Validation.
Startup.cs
services.AddFormHelper();
With configuration: (optional)
services.AddFormHelper(new FormHelperConfiguration
{
CheckTheFormFieldsMessage = "Your custom message...",
RedirectDelay = 6000,
DebugMode = true
});
View:
var formConfig = new FormConfig(ViewContext)
{
FormId = "ProductForm",
FormTitle = "New Product",
BeforeSubmit = "ProductFormBeforeSubmit", // optional
Callback = "ProductFormCallback" // optional,
};
// <form id="@formConfig.FormId" asp-controller="Home" asp-action="Save"
// ...
@await Html.RenderFormScript(formConfig)
Controller:
[HttpPost, FormValidator]
public IActionResult Save(FormViewModel viewModel)
The list of validators supported on the client is on this page and are as follows:
So far i know there is no list, you could create your own client side validator so create that createrthen works also on client side