Click to See Complete Forum and Search --> : Locking a CheckBox in HTML


techraj
February 24th, 2003, 05:50 AM
Hi all,


I have to lock a Checkbox in HTML, I don't want to disable it since it spoils the look of the site, is there any way to lock it as though we do with a textbox, if so How Can Anyone plz help on this

Regards
Raj

antares686
February 24th, 2003, 06:10 AM
I usually try to control what can happen. Most times I want the item to be able to be set on but no off so I do like so.


<SCRIPT LANGUAGE=JAVASCRIPT>
var IsClicked = 0;

function SetClick()
{
if (IsClicked)
BOB.checked = true;
else
IsClicked=1;
}

</SCRIPT>

<INPUT TYPE=checkbox NAME=BOB OnClick="SetClick()">Test


This will allow to be set on but trying to click off just sets value on.

Not sure of any other way to do what you ask.

techraj
February 24th, 2003, 09:53 PM
Thanks anyway I will try to build the logic from here

regards
Raj