blob: 566ac7071b4eb6c8bb0019f9d83ff0b24646b5e8 [file] [log] [blame]
<html>
<body>
<p>This test should make sure that only one button per group, per form, is checked.
</p>
These buttons are in group1 but don't have a form.
<input type="radio" name="group1" id='in1' checked = true/>
<input type="radio" name="group1" id='in2' checked = true/>
<form>
<br>These buttons are in group1, in the first form.
<input type="radio" name="group1" id='in3' checked = true/>
<input type="radio" name="group1" id='in4' checked = true/>
<br>These buttons are in group2, in the first form.
<input type="radio" name="group2" id='in5' checked = true/>
<input type="radio" name="group2" id='in6' checked = true/>
</form>
These buttons are in group1 but don't have a form.
<input type="radio" name="group1" id='in7' checked = true/>
<input type="radio" name="group1" id='in8' checked = true/>
<form>
<br>These buttons are in group2, in the second form.
<input type="radio" name="group2" id='in9' checked = true/>
<input type="radio" name="group2" id='in10' checked = true/>
</form>
<div id="result"></div>
<script>
if (window.testRunner)
testRunner.dumpAsText();
var i1, i2, i3, i4, i5, i6, i7, i8, i9, i10;
i1 = document.getElementById('in1').checked;
i2 = document.getElementById('in2').checked;
i3 = document.getElementById('in3').checked;
i4 = document.getElementById('in4').checked;
i5 = document.getElementById('in5').checked;
i6 = document.getElementById('in6').checked;
i7 = document.getElementById('in7').checked;
i8 = document.getElementById('in8').checked;
i9 = document.getElementById('in9').checked;
i10 = document.getElementById('in10').checked;
if (i1 || i2 || i7 || !i8 || i3 || !i4 || i5 || !i6 || i9 || !i10) {
document.getElementById('result').innerHTML = "TEST FAILED.";
} else {
document.getElementById('result').innerHTML = "TEST PASSED.";
}
</script>
</body>
</html>