-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathEditor.razor
More file actions
38 lines (34 loc) · 1010 Bytes
/
Editor.razor
File metadata and controls
38 lines (34 loc) · 1010 Bytes
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
@page "/editor"
<h3>Editor</h3>
<EditForm Model="@bookEditModel" OnValidSubmit="HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />
<p>
<label>
Title:
<InputText @bind-Value="bookEditModel.Title" />
</label>
</p>
<p>
<label>
Type:
<InputSelect @bind-Value="bookEditModel.Type">
<option value="Hardcover">Hardcover</option>
<option value="Ebook">Ebook</option>
</InputSelect>
</label>
</p>
<p>
<label>
Release date:
<InputDate @bind-Value="bookEditModel.ReleaseDate" />
</label>
</p>
<button type="submit">Submit</button>
<div>@validText</div>
</EditForm>
@code {
private BookEditModel bookEditModel = new();
private string validText = string.Empty;
private void HandleValidSubmit(EditContext context) => validText = "Input is valid, ready to send it to the server";
}