-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
Description
My model has a bool
bound to a checkbox. It's not required, so I should be able to submit the form without checking it. But validation fails for the checkbox and I can't submit.
I tried the demo, and it also fails.
The demo has this:
[BindProperty]
public InputModel Input { get; set; } = new();
// ...
public class InputModel
{
[Remote("CheckboxRemote", "Validations", HttpMethod = "Post")]
public bool IsChecked { get; set; }
}
When trying to submit the form on the http://localhost:5000/Demos/Checkboxes
page:
NET renders a checkbox and a hidden input ... it is unchecked. Unchecking it should not fail validation.
'IsChecked' is invalid. This is not checked
One can easily verify this repro, just run the demo, go to that page and click submit.
I think it's a bug.
Metadata
Metadata
Assignees
Labels
No labels