You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/form/overview.md
+2-77Lines changed: 2 additions & 77 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,84 +21,9 @@ The <a href = "https://demos.telerik.com/blazor-ui/form/overview" target="_blank
21
21
* Set the `EditContext` parameter to an [`EditContext` instance](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.forms.editcontext). The object instance from which the `EditContext` is created is important, especially when using [FormItem templates](slug:form-formitems-template) and [validation messages](slug:form-validation).
22
22
1. (optional) To enable [form validation](slug:form-validation), add the `<FormValidation>` tag. Define a validator component inside, for example the [`DataAnnotationsValidator`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.forms.dataannotationsvalidator) that is part of .NET Core.
23
23
24
-
<divclass="skip-repl"></div>
25
-
````RAZOR Model
26
-
@* Provide a model to the Telerik Form *@
24
+
>caption Basic Blazor Form
27
25
28
-
@using System.ComponentModel.DataAnnotations
29
-
30
-
<TelerikForm Model="@PersonModel">
31
-
<FormValidation>
32
-
<DataAnnotationsValidator />
33
-
</FormValidation>
34
-
</TelerikForm>
35
-
36
-
@code {
37
-
private Person PersonModel { get; set; } = new Person();
38
-
39
-
public class Person
40
-
{
41
-
[Editable(false)]
42
-
public int Id { get; set; }
43
-
44
-
[Required]
45
-
[MaxLength(20, ErrorMessage = "The first name should be maximum 20 characters long")]
46
-
[Display(Name = "First Name")]
47
-
public string FirstName { get; set; }
48
-
49
-
[Required]
50
-
[MaxLength(25, ErrorMessage = "The last name should be maximum 25 characters long")]
0 commit comments