Open ivancavlek opened 3 years ago
Not at the moment but it could be added sometime in the future.
The built-in validation would require significant API changes to the RTE. We will move this feature to v2.0.
Until then, as a workaround the validation can be done as follows:
<RichTextEdit @ref="richTextEditRef"
ConfigureQuillJsMethod="blazoriseDemo.configureQuillJs"
ContentChanged="@OnContentChanged"
Border="@( string.IsNullOrWhiteSpace( contentAsText ) ? Border.Danger : null)">
...
</RichTextEdit>
@if ( string.IsNullOrWhiteSpace( contentAsText ) )
{
<Paragraph TextColor="TextColor.Danger">Text is empty</Paragraph>
}
else
{
<Paragraph TextColor="TextColor.Success">Text is valid</Paragraph>
}
@code{
private string contentAsText;
public async Task OnContentChanged()
{
contentAsText = await richTextEditRef.GetTextAsync();
}
}
Hi!
Is it possible to validate RichTextBoxes and how? If not, will this feature be added?
Regards, Ivan