-
Notifications
You must be signed in to change notification settings - Fork 468
Expand file tree
/
Copy pathFieldStatesExample.razor
More file actions
46 lines (36 loc) · 1.29 KB
/
FieldStatesExample.razor
File metadata and controls
46 lines (36 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<EditForm Model="@model" OnValidSubmit="@HandleValidSubmit" FormName="entry_form" novalidate="true">
<FluentTextInput Label="Error state"
@bind-Value="model.Text"
MessageState="@MessageState.Error"
Message="This is an error message."
MessageCondition="@FluentFieldCondition.Always"
Required="true" />
<FluentTextInput Label="Warning state"
MessageState="@MessageState.Warning"
Message="This is a warning message."
MessageCondition="@FluentFieldCondition.Always" />
<FluentTextInput Label="Success state"
MessageState="@MessageState.Success"
Message="This is a success message."
MessageCondition="@FluentFieldCondition.Always" />
<FluentTextInput Label="Custom state"
Message="This is a custom message."
MessageIcon="@(new Icons.Regular.Size24.Accessibility())"
MessageCondition="@FluentFieldCondition.Always" />
<div>
<FluentButton Type="ButtonType.Submit" Appearance="ButtonAppearance.Primary">Submit</FluentButton>
</div>
</EditForm>
@code {
[SupplyParameterFromForm]
private Model model { get; set; } = new();
private void HandleValidSubmit()
{
Console.WriteLine("HandleValidSubmit called");
// Process the valid form
}
private class Model
{
public string? Text { get; set; } = string.Empty;
}
}