Opera input type="checkbox" Problem

S

spolsky

try the the following code with Opera 9.01 (Windows). when clicked
slightly faster than normal clicking, the toggler checkbox and other
checkboxes displays differently although event method works fine to
update the checkboxes. there is not any problem with IE 6 or FireFox
1.5. also, i used the double click event method to see if its the
source but that does not help even. Opera 9.01 seems to be slow at
updating checkboxes visually. am i missing something or are there any
work arounds, solutions for this problem.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9"
/>
<title>Untitled Document</title>
</head>

<body>
<br />
<span id="span1"></span>
<br />
<span id="span2"></span>
<br />
<br />

<script>
var
clickCount = 0;
function toggleChecks(toggler)
{
clickCount++;
var oSpan1 = document.getElementById("span1");
oSpan1.innerHTML = "click : " + clickCount;

var
o = document.getElementsByName("selRow"),
chk = toggler.checked;

var len = o.length;
for (i = 0; i < len; i++)
{
o.checked = chk;
// check if really checked.
if (o.checked != chk)
alert("not set");
}
}

var
dblclickCount = 0;

function dblClick(toggler)
{
toggleChecks(toggler);
dblclickCount++;

var oSpan2 = document.getElementById("span2");
oSpan2.innerHTML = "double click : " + dblclickCount;

}
</script>
<input type="checkbox" id="chkToggle" onclick="toggleChecks(this);"
ondblclick="dblClick(this);" />
<label for="chkToggle">Toggle CheckBoxes (Rapidly click this within
Opera 9.01 and observe how check sync. loosed.)</label>
<br />
<input type="checkbox" name="selRow" value="114">
<br />
<input type="checkbox" name="selRow" value="115">
<br />
<input type="checkbox" name="selRow" value="116">
<br />
<input type="checkbox" name="selRow" value="117">
<br />
<input type="checkbox" name="selRow" value="118">
<br />
<input type="checkbox" name="selRow" value="118">
<br />
<input type="checkbox" name="selRow" value="119">
</body>
</html>
 
L

Lee Harvey

spolsky said:
try the the following code with Opera 9.01 (Windows). when clicked
slightly faster than normal clicking, the toggler checkbox and other
checkboxes displays differently although event method works fine to
update the checkboxes.

Yeah, I noticed that too with the Opera 9.x series. :-(

BTW, Opera 8.54 doesn't seem to have this problem.

<snip>
am i missing something or are there any work arounds, solutions for
this problem.

As such, for the time being, the work-arounds seem to be either:

a) Swap-out your onclick event with either onmousedown or onmouseup
b) Click slowly
c) Revert back to 8.54
d) Use an alternate browser.

Cheers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top