Closed adaml984 closed 6 years ago
Can you try using the [StringLength] attribute to ensure there are some characters?
It's been a while since I've worked on this, but I vaguely remember that strings are a bit funny, due to whitespace being a valid value.
There's maybe some work to needed on https://github.com/mcintyre321/FormFactory/blob/master/FormFactory/UnobtrusiveValidation/ClientValidationRules.cs
thanks, I got this working.
Best regards, Adam
Hello, Form the beginning, here's part of my viewmodel, two sample properties: [Required] public string CompanyName { get; set; }
[Required] [Radio] public ContractType ContractType { get; set; }
Here's how I build form:
When I post form and CompanyName is empty/null I don't get validation message that says CompanyName is required. On the other hand when ContractType enum value is not set I get message that says ContractType is required. It seems that Required on string properties does not work or I'm missusing it. Could you clarify how to use that attribute?