[thelist] Dumb Question (Javascript) but still causing difficulties

Dan Frey danieljohnfrey at yahoo.com
Tue May 11 15:03:56 CDT 2004


Is inserting an image of a checked checkbox and a hidden input an option?
Checkboxes may not look the same cross-browser/cross-OS, but it might be
something to think about.

Dan
-----Original Message-----
From: thelist-bounces at lists.evolt.org 
Subject: [thelist] Dumb Question (Javascript) but still causing difficulties

Hi,

I'm having a slightly stubborn problem with a particular checkbox issue:

<input type="checkbox" name="Something" value="Something else" checked
onFocus="blur()">

Ok. This checkbox is supposed to be checked initially, but at the same time,
the user cannot uncheck this checkbox. Don't ask why, it's just supposed to
act this way. Specifically, "I don't care how many times the user clicks on
that checkbox, it is not supposed to uncheck."

I have done some initial research and people have said you have to use an
OnClick event handler for a check box:

<input type="checkbox" name="Something" value="Something else" checked
onClick="blur()">

..out of shear curiosity I tried this:

<input type="checkbox" name="Something" value="Something else" checked
onClick="alert('Hi')">

Alas, to no avail none of these work. I'm using IE 6 in a windows 2k box. I
even have this in my body tag, but removing it did not solve my problem
either:
onContextMenu="return false" onSelectStart="return false"
onDragStart="return false"

One last detail I might mention that must be and is by design. All
checkboxes are named the same thing. I am going for a comma delimited list
when the form submits. There are about 60 of these checkboxes.

I'd appreciate some light on this,

Rob.Smith 



More information about the thelist mailing list