[Javascript] intermediate state of a checkbox

Mckinney, Lori K lkmckinn at ingr.com
Thu Oct 2 08:49:09 CDT 2003


IE has it
 
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/ref
erence/properties/indeterminate.asp
<http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/re
ference/properties/indeterminate.asp> 
 
I've used it in our (IE 5+ only) application.  Our application of it looks
similar to the checked tree view in VB.Net.  There is a category that has a
checkbox and under it are values that each have a check.  If you check the
category, all of the values get checked.  If you check a value and it turns
out that you have now checked all of the values, the category gets checked.
If some of the values are checked and some are not, the checkbox is set
indeterminate.  So the category check box is not checked and neither are any
of the values, they are all checked or some of the values are checked and
the category is checked indeterminate.  Here is a little snippet.
 
 // went through all of the child checks and they all match compareState
(true or false) so set the parent check to match compareState
 if ( ! allChildChecksMatch )
 {
  topCheck.indeterminate = false;
  topCheck.checked = compareState;
 }
 else
 {
  topCheck.indeterminate = true;
 }


-----Original Message-----
From: Dan Costea [mailto:costea.dan at ssi-schaefer.ro]
Sent: Thursday, October 02, 2003 1:22 AM
To: javascript at LaTech.edu
Subject: [Javascript] intermediate state of a checkbox


    Hi to all!
 
How can I set from JavaScript the intermediate state of a checkbox? (see
pic. from attachment to see what I mean with "intermediate state")
 
Thank you,
Dan Costea.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20031002/a67f0891/attachment.htm>


More information about the Javascript mailing list