I have a fairly simple edit form in a dialog box in Blazor server app. Added validation to it and it is working nicely.
I dislike fields jumping around when displaying validation messages (see below). Would like to have extra space below the fields when there is no message, and then replace that with the validation message if validation fails.
Seems like it should be simple. In my razor file just us an @if statement to display a row or a message depending on the fields validation status. But for the life of me I cannot find the property for each field. It must exist as I can get a message and I see the boxes in read?
Any suggestion on how to do this?
Razor file
<div class="form-group input-group">
<span class="has-float-label">
<SfTextBox id="Owner" @bind-Value="template.Owner" class="form-control" placeholder="Owner" />
<label for="Owner">Owner</label>
@if (template.Owner.ISVALID)
{<span> </span>}
else
{ <ValidationMessage For="@(() => template.Owner)"></ValidationMessage>}
</span>
</div>