User-2029935383 posted
Hello,
I am having problems with making textarea firing the data annotation validation.
here's the html (razor) part
<div class="row mt-4">
<div class="col">
<label asp-for="consent">Some text here</label>
<textarea id="content" asp-for="consent" name="content" class="form-control" rows="25">
</textarea>
<ul class="ul-no-style">
<li><span asp-validation-for="consent" class="text-danger small"></span></li>
</ul>
</div>
</div>
and the data annotation part:
[BindProperty]
[Required(ErrorMessage = "Please do not leave the cookie consent message empty. The field is required.")]
[DataType(DataType.MultilineText)]
public string consent { get; set; }
P.S. The textarea is TinyMCE placeholder.
All other validations are firing, no problems there except this one, why?
Someone?
Thanks