@@ -40,33 +40,33 @@ Simple textbox-like inputs do not have any special behavior. You need to bind th
40
40
@using Telerik.Blazor.Components.DatePicker
41
41
@using System.ComponentModel.DataAnnotations
42
42
43
- <EditForm Model="@person" OnValidSubmit="@HandleValidSubmit">
44
- <DataAnnotationsValidator />
45
- <ValidationSummary />
46
-
47
- <p class="name">
48
- Name: <TelerikTextBox bind-Value="@person.Name"></TelerikTextBox>
49
- <ValidationMessage For="@(() => person.Name)"></ValidationMessage>
50
- </p>
51
- <p class="height">
52
- Height (cm): <TelerikNumericTextBox bind-Value="@person.Height" />
53
- <ValidationMessage For="@(() => person.Height)"></ValidationMessage>
54
- </p>
55
- <p class="birthday">
56
- Birthday: <TelerikDateInput bind-Value="@person.Birthday" Format="dd MMMM yyyy"></TelerikDateInput>
57
- <ValidationMessage For="@(() => person.Birthday)"></ValidationMessage>
58
- </p>
59
- <p class="favorite-day">
60
- Birthday: <TelerikDatePicker bind-Value="@person.FavoriteDay" Format="dd MMMM yyyy"></TelerikDatePicker>
61
- <ValidationMessage For="@(() => person.FavoriteDay)"></ValidationMessage>
62
- </p>
63
- <p class="accepts-terms">
64
- Accepts terms: <InputCheckbox bind-Value="@person.AcceptsTerms" />
65
- <ValidationMessage For="@(() => person.AcceptsTerms)"></ValidationMessage>
66
- </p>
67
-
68
- <button type="submit">Submit</button>
69
- </EditForm>
43
+ <EditForm Model="@person" OnValidSubmit="@HandleValidSubmit">
44
+ <DataAnnotationsValidator />
45
+ <ValidationSummary />
46
+
47
+ <p class="name">
48
+ Name: <TelerikTextBox bind-Value="@person.Name"></TelerikTextBox>
49
+ <ValidationMessage For="@(() => person.Name)"></ValidationMessage>
50
+ </p>
51
+ <p class="height">
52
+ Height (cm): <TelerikNumericTextBox bind-Value="@person.Height" />
53
+ <ValidationMessage For="@(() => person.Height)"></ValidationMessage>
54
+ </p>
55
+ <p class="birthday">
56
+ Birthday: <TelerikDateInput bind-Value="@person.Birthday" Format="dd MMMM yyyy"></TelerikDateInput>
57
+ <ValidationMessage For="@(() => person.Birthday)"></ValidationMessage>
58
+ </p>
59
+ <p class="favorite-day">
60
+ Birthday: <TelerikDatePicker bind-Value="@person.FavoriteDay" Format="dd MMMM yyyy"></TelerikDatePicker>
61
+ <ValidationMessage For="@(() => person.FavoriteDay)"></ValidationMessage>
62
+ </p>
63
+ <p class="accepts-terms">
64
+ Accepts terms: <InputCheckbox bind-Value="@person.AcceptsTerms" />
65
+ <ValidationMessage For="@(() => person.AcceptsTerms)"></ValidationMessage>
66
+ </p>
67
+
68
+ <button type="submit">Submit</button>
69
+ </EditForm>
70
70
71
71
@functions {
72
72
// Usually this class would be in a different file
@@ -85,9 +85,10 @@ Simple textbox-like inputs do not have any special behavior. You need to bind th
85
85
ErrorMessage = "Value for {0} must be between {1:dd MMM yyyy} and {2:dd MMM yyyy}")]
86
86
public DateTime Birthday { get; set; }
87
87
88
- [Required(ErrorMessage = "You must surely have a favorite day.") ]
88
+ [Required]
89
89
[Range(typeof(DateTime), "1/1/1999", "1/12/2019",
90
90
ErrorMessage = "Value for {0} must be between {1:dd MMM yyyy} and {2:dd MMM yyyy}")]
91
+ [Display(Name="Your Favourite Day")]
91
92
public DateTime FavoriteDay { get; set; }
92
93
93
94
[Required]
0 commit comments