@@ -30,8 +30,7 @@ In the following component, the `HandleValidationRequested` handler method clear
30
30
31
31
<h2>Holodeck Configuration</h2>
32
32
33
- <EditForm method="post" EditContext="editContext" OnValidSubmit="@Submit"
34
- FormName="Starship8">
33
+ <EditForm EditContext="editContext" OnValidSubmit="@Submit" FormName="Starship8">
35
34
<div>
36
35
<label>
37
36
<InputCheckbox @bind-Value="Model!.Subsystem1" />
@@ -327,7 +326,7 @@ When validation messages are set in the component, they're added to the validato
327
326
328
327
<h2>New Ship Entry Form</h2>
329
328
330
- <EditForm method="post" Model="@Model" OnValidSubmit="@Submit" FormName="Starship9">
329
+ <EditForm Model="@Model" OnValidSubmit="@Submit" FormName="Starship9">
331
330
<CustomValidation @ref="customValidation" />
332
331
<ValidationSummary />
333
332
<div>
@@ -739,7 +738,7 @@ In the following component, update the namespace of the **`Shared`** project (`@
739
738
740
739
<h2>New Ship Entry Form</h2>
741
740
742
- <EditForm method="post" Model="@Model" OnValidSubmit="@Submit" FormName="Starship10">
741
+ <EditForm Model="@Model" OnValidSubmit="@Submit" FormName="Starship10">
743
742
<DataAnnotationsValidator />
744
743
<CustomValidation @ref="customValidation" />
745
744
<ValidationSummary />
@@ -1042,7 +1041,7 @@ The `CustomInputText` component can be used anywhere <xref:Microsoft.AspNetCore.
1042
1041
@rendermode RenderMode.InteractiveServer
1043
1042
@inject ILogger<Starship11> Logger
1044
1043
1045
- <EditForm method="post" Model="@Model" OnValidSubmit="@Submit" FormName="Starship11">
1044
+ <EditForm Model="@Model" OnValidSubmit="@Submit" FormName="Starship11">
1046
1045
<DataAnnotationsValidator />
1047
1046
<ValidationSummary />
1048
1047
<CustomInputText @bind-Value="Model!.Id" />
@@ -1254,25 +1253,20 @@ The following component validates user input by applying the `SaladChefValidator
1254
1253
@inject SaladChef SaladChef
1255
1254
1256
1255
<EditForm Model="@this" autocomplete="off" FormName="Starship12">
1257
-
1258
1256
<DataAnnotationsValidator />
1259
-
1260
1257
<p>
1261
1258
<label>
1262
1259
Salad topper (@saladToppers):
1263
1260
<input @bind="SaladIngredient" />
1264
1261
</label>
1265
1262
</p>
1266
-
1267
1263
<button type="submit">Submit</button>
1268
-
1269
1264
<ul>
1270
1265
@foreach (var message in context.GetValidationMessages())
1271
1266
{
1272
1267
<li class="validation-message">@message</li>
1273
1268
}
1274
1269
</ul>
1275
-
1276
1270
</EditForm>
1277
1271
1278
1272
@code {
@@ -1295,25 +1289,20 @@ The following component validates user input by applying the `SaladChefValidator
1295
1289
@inject SaladChef SaladChef
1296
1290
1297
1291
<EditForm Model="@this" autocomplete="off">
1298
-
1299
1292
<DataAnnotationsValidator />
1300
-
1301
1293
<p>
1302
1294
<label>
1303
1295
Salad topper (@saladToppers):
1304
1296
<input @bind="SaladIngredient" />
1305
1297
</label>
1306
1298
</p>
1307
-
1308
1299
<button type="submit">Submit</button>
1309
-
1310
1300
<ul>
1311
1301
@foreach (var message in context.GetValidationMessages())
1312
1302
{
1313
1303
<li class="validation-message">@message</li>
1314
1304
}
1315
1305
</ul>
1316
-
1317
1306
</EditForm>
1318
1307
1319
1308
@code {
@@ -1412,8 +1401,7 @@ Set the `CustomFieldClassProvider` class as the Field CSS Class Provider on the
1412
1401
@rendermode RenderMode.InteractiveServer
1413
1402
@inject ILogger<Starship13> Logger
1414
1403
1415
- <EditForm method="post" EditContext="@editContext" OnValidSubmit="@Submit"
1416
- FormName="Starship13">
1404
+ <EditForm EditContext="@editContext" OnValidSubmit="@Submit" FormName="Starship13">
1417
1405
<DataAnnotationsValidator />
1418
1406
<ValidationSummary />
1419
1407
<InputText @bind-Value="Model!.Id" />
@@ -1782,8 +1770,7 @@ To enable and disable the submit button based on form validation, the following
1782
1770
@implements IDisposable
1783
1771
@inject ILogger<Starship14> Logger
1784
1772
1785
- <EditForm method="post" EditContext="@editContext" OnValidSubmit="@Submit"
1786
- FormName="Starship14">
1773
+ <EditForm EditContext="@editContext" OnValidSubmit="@Submit" FormName="Starship14">
1787
1774
<DataAnnotationsValidator />
1788
1775
<ValidationSummary />
1789
1776
<div>
0 commit comments