Re: CheckBoxList and Cicle For
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: CheckBoxList and Cicle For

From: RobG <rgqld@iinet.net.au>
Date: Wed Feb 01 2006 - 03:40:20 CET

Diego_Atos wrote:
> Risposta a:
> "Tony" <tony23@dslextreme.com>
> __________________________
>
>>Diego_Atos wrote:
>>
>>>Hi you all.
>>>I've an asp.net control, a checkboxlist.
>>
>>Wrong newsgroup, then. This is a JavaScript NG.
>>
>>
>>>I want to read "checked" properties for all items of my control.
>>>How can i do it?
>>
>>You would probably have better luck getting an answer in a .NET
>>newsgroup.
>
>
> No, i need a client control

But you are posting ASP server code.

<URL:http://msdn2.microsoft.com/system.web.ui.webcontrols.checkboxlist.aspx>

Randy already answered your question.

Give them all the same name and use document.getElementsByName() to get
a reference to the collection of checkboxes. Loop through them to see
which are checked.

Otherwise, put them all in a div, get a reference to the div then use
divRef.getElementsByTagName('input') to get all the inputs. Then loop
through the collection, test for elementRef.type='checkbox' in case
other inputs are in there too.

-- 
Rob
Received on Tue Feb 7 21:29:30 2006