fix: prevent missing value error for radio button inputs without a name (#36197)

Signed-off-by: Barigbue <barigbuenbira@gmail.com>
This commit is contained in:
Barigbue Nbira 2025-03-28 12:20:59 +01:00 committed by GitHub
parent a925a02c4c
commit 5a4e232cb6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 5 deletions

View file

@ -810,6 +810,9 @@ impl HTMLInputElement {
InputType::Checkbox => self.Required() && !self.Checked(),
// https://html.spec.whatwg.org/multipage/#radio-button-state-(type%3Dradio)%3Asuffering-from-being-missing
InputType::Radio => {
if self.radio_group_name().is_none() {
return false;
}
let mut is_required = self.Required();
let mut is_checked = self.Checked();
for other in radio_group_iter(self, self.radio_group_name().as_ref()) {

View file

@ -1,5 +0,0 @@
[form-validation-validity-valueMissing.html]
type: testharness
[[INPUT in RADIO status\] The checked attribute is false and the name attribute is empty]
expected: FAIL