By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,184 Members | 1,388 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,184 IT Pros & Developers. It's quick & easy.

Opera input type="checkbox" Problem

P: n/a
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[i].checked = chk;
// check if really checked.
if (o[i].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>

Aug 21 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
spolsky wrote:
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.
<snip>
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.
Aug 22 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.