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)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: daniel, Assigned: jst)

Details

Attachments

(1 file)

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"
Attached file Test case
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.
By removing the check for type="radio" or type="check" above, bug 34858 will be fixed too.
Status: NEW → ASSIGNED
Target Milestone: --- → M18
This was fixed when the fix for bug 40571 was checked in, marking fixed.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Verified with 2000-07-07-10.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: