General Version (not dependent on any Class Library)
Function Getcheckboxlistvalue (objid)
{
VaR V = New Array ();
VaR Checkboxlist = Document. getelementbyid (objid );
If (Checkboxlist. tagname = " Table " )
{
For (I = 0 ; I < Checkboxlist. Rows. length; I ++ )
For (J = 0 ; J < Checkboxlist. Rows [I]. cells. length; j ++ )
If (Checkboxlist. Rows [I]. cells [J]. childnodes [ 0 ])
If (Checkboxlist. Rows [I]. cells [J]. childnodes [ 0 ]. Checked = True )
V. Push (checkboxlist. Rows [I]. cells [J]. childnodes [ 1 ]. Innertext );
}
If (Checkboxlist. tagname = " Span " )
{
For (I = 0 ; I < Checkboxlist. childnodes. length; I ++ )
If (Checkboxlist. childnodes [I]. tagname = " Input " )
If (Checkboxlist. childnodes [I]. Checked = True )
{
I ++ ;
V. Push (checkboxlist. childnodes [I]. innertext );
}
}
Return V;
}
Asp.net AjaxVersion (dependencyAsp.net AjaxClass Library Support)
Function Getcheckboxlistvalue (objid)
{
VaR V = New Array ();
VaR Checkboxlist = $ Get (objid );
If (Checkboxlist. tagname = " Table " )
{
For (I = 0 ; I < Checkboxlist. Rows. length; I ++ )
For (J = 0 ; J < Checkboxlist. Rows [I]. cells. length; j ++ )
If (Checkboxlist. Rows [I]. cells [J]. childnodes [ 0 ])
If (Checkboxlist. Rows [I]. cells [J]. childnodes [ 0 ]. Checked = True )
Array. Add (v, checkboxlist. Rows [I]. cells [J]. childnodes [ 1 ]. Innertext );
}
If (Checkboxlist. tagname = " Span " )
{
For (I = 0 ; I < Checkboxlist. childnodes. length; I ++ )
If (Checkboxlist. childnodes [I]. tagname = " Input " )
If (Checkboxlist. childnodes [I]. Checked = True )
{
I ++ ;
Array. Add (v, checkboxlist. childnodes [I]. innertext );
}
}
Return V;
}< P>
conversion from: http://www.cnblogs.com/SoulStore/archive/2008/07/09/1239126.html