CheckBoxList and Cicle For

D

Diego_Atos

Hi you all.
I've an asp.net control, a checkboxlist.

I want to read "checked" properties for all items of my control.
How can i do it?

I read some tips on the net, but none of them works.


Thanks
 
R

Randy Webb

Diego_Atos said the following on 1/30/2006 5:42 PM:
Hi you all.

I am not "you all" but have always wanted to meet "you all" though. If
you find him/her let me know so I can meet them.
I've an asp.net control, a checkboxlist.

"checkboxlist"? WTF is that? Is it a checkbox, a list, a select list or
some ASP-centric thingie?
I want to read "checked" properties for all items of my control.
How can i do it?

Write a script that will loop through the checkbox collection based on a
common name or the common tag. Search the archives.
I read some tips on the net, but none of them works.

My stereo doesn't play sound. Whats wrong?

The point of that paragraph is that "none of them work" is a useless
description if you don't show what doesn't work.

Sidenote: All scripts "work" as written, they just don't always do what
the script author wanted them to do.
 
T

Tony

Diego_Atos said:
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.
 
D

Diego_Atos

Risposta a:
Tony said:
Wrong newsgroup, then. This is a JavaScript NG.


You would probably have better luck getting an answer in a .NET
newsgroup.

No, i need a client control

thanks
 
R

RobG

Diego_Atos said:
Risposta a:



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.
 
D

Diego_Atos

Risposta a:
RobG said:
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.

Thanks
 
T

Tony

Diego_Atos said:
No, i need a client control

AFAIK, there is no such thing as a "control" in Javascript. That's why
I made the NG suggestion - they'll be more likely to speak the same
language on a .NET newsgroup.

I work with a bunch of .NET people - they do the server-side stuff, I
do the client-side stuff. There's all this talk about "controls" for
them, but that's all irrelevant to me - what I'm concerned with is the
HTML that gets rendered.

If nothing else - I hope that might clarify my suggestion a bit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top