Custom Plugin Validator

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
1 年 前
Hello,

I have a custom plugin and I add my validator class but not all the rules applied to the property.
the NotNull rule works fine but greater and less than not working

My Validator Class inherit from BaseNopValidator<MyModel>

RuleFor(x => x.WithdrawalAmount).NotNull().WithMessageAwait("My Error Msg");
RuleFor(x => x.WithdrawalAmount).GreaterThan(0).WithMessageAwait("My Error Msg");
RuleFor(x => x.WithdrawalAmount).LessThan(x => x.CurrentCredit).WithMessageAwait("");


My cshtml class:

<div class="inputs">
                   <label asp-for="WithdrawalAmount" asp-postfix=":"></label>
                   <nop-editor asp-for="WithdrawalAmount" />
                   <nop-required />
                  <span asp-validation-for="WithdrawalAmount"></span>
</div>


Any advice
1 年 前
I get it. the greater and less than not a client-side validators
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.