Hello:
On a web page I check the value of a cookie and set one of two radio
buttons accordingly.
function setRadioForm() {
var myCookie = document.cookie ;
var OpenOnly = myCookie.substr ing(9);
if (OpenOnly == "True") {
document.ViewOp tions.Open.chec ked = true;
}
else {
document.ViewOp tions.All.check ed = true;
}
}
<body onload="setRadi oForm()">
This works fine. The correct radio button appears checked when the
form opens. However, when the user checks one of the buttons (usually
the unchecked one), both buttons remain checked.
Here's the code on the form:
<form name='ViewOptio ns">
<input type="radio" name="Open" value="True"
onclick="setCoo kie("True")> Always, show me open items only.
<input type="radio" name="All" value="False"
onclick=setCook ie("False")>Alw ays show me all items, open and closed.
</form>
The onclick fires correctly, but the button which was not clicked
remains checked. Am I doing something wrong or is this a limitation
in the browser/code?
--
Ken
On a web page I check the value of a cookie and set one of two radio
buttons accordingly.
function setRadioForm() {
var myCookie = document.cookie ;
var OpenOnly = myCookie.substr ing(9);
if (OpenOnly == "True") {
document.ViewOp tions.Open.chec ked = true;
}
else {
document.ViewOp tions.All.check ed = true;
}
}
<body onload="setRadi oForm()">
This works fine. The correct radio button appears checked when the
form opens. However, when the user checks one of the buttons (usually
the unchecked one), both buttons remain checked.
Here's the code on the form:
<form name='ViewOptio ns">
<input type="radio" name="Open" value="True"
onclick="setCoo kie("True")> Always, show me open items only.
<input type="radio" name="All" value="False"
onclick=setCook ie("False")>Alw ays show me all items, open and closed.
</form>
The onclick fires correctly, but the button which was not clicked
remains checked. Am I doing something wrong or is this a limitation
in the browser/code?
--
Ken
Comment