Closed
Bug 36085
Opened 25 years ago
Closed 25 years ago
Radio buttons with the same name visible across forms
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
VERIFIED
FIXED
M18
People
(Reporter: daniel, Assigned: jst)
Details
Attachments
(1 file)
|
488 bytes,
text/html
|
Details |
A page with two forms where both forms have a series of radio buttons with the
same name "leaks" the names to the other form.
See attached testcase for an example. It should pop-up "2" but says "4" instead"
| Reporter | ||
Comment 1•25 years ago
|
||
| Reporter | ||
Comment 2•25 years ago
|
||
The problem appears to be in the implementation of
nsFormControlList::GetNamedObject in
/layout/html/content/src/nsHTMLFormElement.cpp.
Where the following lines:
// If it is, then get all radio buttons or checkboxes with the same name
if (document && (type.EqualsWithConversion("Radio") ||
type.EqualsWithConversion("Checkbox"))) {
nsCOMPtr<nsIDOMHTMLDocument> htmlDoc = do_QueryInterface(document);
if (htmlDoc) {
nsCOMPtr<nsIDOMNodeList> list;
result = htmlDoc->GetElementsByName(name, getter_AddRefs(list));
Queries the document for items with the same name, instead of the form.
| Reporter | ||
Comment 3•25 years ago
|
||
By removing the check for type="radio" or type="check" above, bug 34858 will be
fixed too.
| Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → M18
| Assignee | ||
Comment 4•25 years ago
|
||
This was fixed when the fix for bug 40571 was checked in, marking fixed.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•