Skip to content

Commit

Permalink
split remote demo
Browse files Browse the repository at this point in the history
  • Loading branch information
lonix1 authored Jan 1, 2024
1 parent 71d6499 commit 0c7d5d1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Pages/Demos/Checkboxes.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<legend>Required ASP.NET Checkboxes (with hidden input) and Radio buttons</legend>

<form method="post">

<div class="form-field">
<p>
ASP.NET renders a checkbox and a hidden input for each boolean property.
Expand All @@ -32,6 +33,16 @@
}
</div>

<div class="form-field">
<p>
One can also use the [Remote] validation attribute. In this case, the remote validator returns valid only when the checkbox is checked.
</p>
<label>Is checked
<input asp-for="InputRemote.IsCheckedRemote"/>
</label>
<span asp-validation-for="InputRemote.IsCheckedRemote"></span>
</div>

<div class="form-field">
<p>
However, if you manually render a checkbox, the checkbox is only submitted
Expand Down Expand Up @@ -101,6 +112,7 @@
</div>

<input type="submit" value="Submit"/>

</form>
</fieldset>

Expand Down

0 comments on commit 0c7d5d1

Please sign in to comment.