HTML5 defines the
indeterminate boolean property.
I’ve tested it only in the latest Safari, Chrome, and Firefox. They all support the indeterminate state.
Edit: Note that this wont work with older browsers and maybe not with current versions of IE. You’d need to rely on hacks as described in other answers here if you want to support all browsers.
Nope. You would have to make a custom checkbox graphic and fake it.
Edit: Refer to @Kassen’s answer for a way to have partially checked boxes in HTML5-compliant browsers.
HTML checkboxes (that is,
input elements of type
checkbox) don’t have a third state (partially checked). So no, there is no direct way to do this.
What you’d probably have to do is make a custom checkbox-looking image and bind to its various events (click, for example) to store its current “state” in a
For example, keyboard navigation of the form may not be possible for this particular element. (Can one tab to an image and send it keyboard events? I’m not sure.)
It’s certainly an interesting prospect, and I’m intrigued enough that I may try to implement something like this in the near future. But with a native checkbox element, it’s not possible. It has only two states.
Edit: Refer to @kassens’ answer for doing this in HTML5. If you’re limited to previous versions of HTML for any reason, then it’s going to have to be a hack as described here. But if you can rely on users supporting HTML5, then it looks like native support is there.