You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Design (per the /engineering:system-design request): a form where two
or more controls share a name attribute is a common, silent bug —
copy-pasted markup, a duplicated "add another" field group, a
templated component. Standard form encoding keeps only one value (or
silently merges them in a way the server likely doesn't expect) for a
repeated key, so a user filling in two different pieces of information
has one vanish on submit with zero client-side signal. Axe-core has no
concept of submission semantics, so it doesn't (and can't) catch this,
and none of the other eight checks do either.
check_duplicate_names groups every named input/select/textarea in the
target form by name and flags any group of 2+ where the elements
aren't all radios (mutual exclusion is the whole point of sharing a
name there) or all checkboxes (a checkbox group commonly and
legitimately shares one name too). Anything else sharing a name — two
text fields, a text field colliding with a checkbox, etc. — is a real
defect in the form itself, so this is a Fail, not a heuristic-limit
Warn like Bot protection.
fixtures/duplicate-name-form.html covers both the violation (two
unrelated fields both named "email") and the two legitimate exclusions
(a radio group and a checkbox group sharing a name each) in one
fixture, so the same test proves the check flags the real bug without
false-positiving on either legitimate pattern.
Verified both directions by mutation: removed the radio/checkbox
exclusion entirely and confirmed the false-positive assertions caught
it (flagging "contact" and "interests" alongside "email"), then forced
the JS to always return an empty dupes list and confirmed the Fail
assertion caught that too, before restoring the real logic.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0 commit comments