Closed Bug 3347 Opened 26 years ago Closed 26 years ago

checking a radio button via dom doesn't uncheck currently checked button

Categories

(Core :: DOM: Core & HTML, defect, P2)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: paul, Assigned: karnaze)

Details

In the following, if you press the "check button" button, you'll see that both
radio buttons are checked simultaneously.

<html>
<body>

<form name="form1">
<input type=button name="but1" value="print values" onclick="printValues()">
<input type=button name="but2" value="check button" onclick="checkButton()">
<BR>
<input type=radio checked name="foo">radio1<BR>
<input type=radio name="foo">radio2<BR>
</form>

<script>

var fld = document.form1.elements;
var len = fld.length;

function printValues() {
	dump("\nnumber of fields = " + len + "\n");
	for (var i = 0; i < len; i++) {
	    dump("\n" + i + ". name = " + fld[i].name + ", checked = " +
fld[i].checked)
	}
	dump("\n");
}

function checkButton() {
	fld[3].checked=true;
}

</script>

</body>
</html>
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
QA Contact: 4110 → 4137
Reassigning QA contact to cpratt@netscape.com (FORM related).
Status: RESOLVED → VERIFIED
I have already verified this fixed so I'll mark it as so.
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.