|
-
Jan 10th, 2003, 06:13 AM
#1
Thread Starter
Junior Member
checkbox question (HTML)
i'm not sure if this is the right forum for it. my question is,
how can I disable a checkbox on html page using either css(preferably) or any way. i used 'disabled' attribute. but it greys out the check box. I dont want it to look grey.
and plz be quick.
-
Jan 10th, 2003, 06:33 AM
#2
total hack
Code:
<input type="checkbox" onclick="this.checked=false">
-
Jan 10th, 2003, 06:39 AM
#3
Thread Starter
Junior Member
great:
i would use:
<input type="checkbox" onclick="this.checked= !this.checked">
-
Jan 10th, 2003, 06:50 AM
#4
thats worked out as quite an elegant solution,
but users should have some way of knowing it's disabled and not just click mindlessly.
-
Jan 10th, 2003, 08:25 AM
#5
Frenzied Member
By the way I think you should be able to use the disabled pseudo class (just going from memory, so I'm not sure if I'm right), but I have a suspicion IE won't support it:
Code:
input:disabled {
background:white;
color:black;
}
if it isn't in the CSS 2 specs I think it's in 3, but you can use this (again won't work in IE)
Code:
input[disabled] {
background:white;
color:black;
}
Which is preferable to JavaScript, as not every has it (10-15%).
Last edited by Rick Bull; Jan 10th, 2003 at 08:30 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|