Skip to content

Commit

Permalink
Update src/OrchardCore.Modules/OrchardCore.Forms/Views/Items/InputPar…
Browse files Browse the repository at this point in the history
…t.cshtml

Co-authored-by: Sébastien Ros <sebastienros@gmail.com>
  • Loading branch information
rjpowers10 and sebastienros authored Nov 15, 2024
1 parent 8c938eb commit 3827933
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
{
if (Model.Value.Type == "checkbox")
{
// Unlike other input controls, a checkbox's value is only included in the
// submitted data if the checkbox is currently checked. If it is, then the
// value of the checkbox's value attribute is reported as the input's value,
// or 'on' if no value is set.
// c.f. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#additional_attributes
isChecked = fieldEntry.AttemptedValue == (fieldValue ?? "on");
}
else
Expand Down

0 comments on commit 3827933

Please sign in to comment.