Files
436597edef Core: Validate inputs with duplicate name / name[] arrays, instead of just the first item (#2498)
* Allow input name arrays

* Allow input name arrays

* Core: Fix checkbox name cache and add name[] tests

Use the DOM element's name so each checkbox/radio group is cached
separately, keep groups first-only in elements(), and cover name[]
plus duplicate-name text inputs.

* Core: wip

* Core: wip

* Core: Pick the plain-name owner from the elements that get validated

uniqueName() handed the plain name to the first element of that name
after only the ignore filter, so a disabled, submit/reset/image or
rule-less element in front of the one field elements() validates
pushed that field to "name-2". errorMap keys, the invalid map and the
error label of an id-less field then no longer matched the plain name
they had before. Use the same filter as elements() when choosing the
first element.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Core: Keep a checkbox/radio group's name exclusive to the group

elements() only skipped later checkables of an already seen name, so a
text or hidden input following a checkbox/radio group of the same name
was validated with the group's name-keyed rules, and could fail them in
ways the user cannot fix (e.g. a hidden companion with ignore: []).
Record whether a name was claimed by a checkable and skip every other
element of that name, as before this branch. Such companions also keep
sharing the group's plain key in uniqueName().

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Core: Stop remote() polluting Object.prototype via the message stash

For an input named "__proto__" (or "constructor"), settings.messages[
key ] resolves to an inherited member, so stashing the remote message
on it wrote Object.prototype.remote and broke validation page-wide.
Only write to an own entry of the messages map, creating it with
Object.defineProperty where needed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: bytestream <kieran@supportpal.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-26 14:39:21 +00:00
..
2016-07-22 17:56:18 +02:00
2016-07-22 17:56:18 +02:00