473,402 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

CheckBoxList and Cicle For

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
--
-La lunghezza effettiva della vita č data dal numero
-di giorni diversi che un individuo riesce a vivere.
-Quelli uguali non contano (De Crescenzo)
-Per rispondere in privato potare "POTA" dall'indirizzo-
Jan 30 '06 #1
6 1690
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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 31 '06 #2
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.

Jan 31 '06 #3
Risposta a:
"Tony" <to****@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

thanks
--
-La lunghezza effettiva della vita č data dal numero
-di giorni diversi che un individuo riesce a vivere.
-Quelli uguali non contano (De Crescenzo)
-Per rispondere in privato potare "POTA" dall'indirizzo-
Jan 31 '06 #4
Diego_Atos wrote:
Risposta a:
"Tony" <to****@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
Feb 1 '06 #5
Risposta a:
RobG <rg***@iinet.net.au>
__________________________

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

--
-La lunghezza effettiva della vita č data dal numero
-di giorni diversi che un individuo riesce a vivere.
-Quelli uguali non contano (De Crescenzo)
-Per rispondere in privato potare "POTA" dall'indirizzo-
Feb 1 '06 #6
Diego_Atos wrote:
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


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

Feb 2 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bryce Budd | last post by:
Hello All, I've been a taker of information from newsgroups for a long time and thought I'd finally make a contribution back to the community whose supported me when I've needed it. After all...
4
by: dm_dal | last post by:
Is there a know issue surrounding the CheckBoxList control and it's viewstate? When my control is created, it's ListItems are checked as needed, but on a postback, they loose their Selected...
4
by: Shaul Feldman | last post by:
Hello, I have something really awkward at work - fighting with CheckBoxList... How can I define CSS for ListItem in CheckBoxList programmatically. I add CheckBoxList's Items on the fly, something...
5
by: Eirik Eldorsen | last post by:
I'm trying to code a reapter that for each listelement show a checkboxlist. I'm almost there. The only thing I can't figure out is how to set the ID of the checkboxlists. This is my code:...
3
by: I am Sam | last post by:
I keep getting the following error message when I try to iterate through a CheckBoxList control: Object reference not set to an instance of an object. Description: An unhandled exception...
5
by: Patrick.O.Ige | last post by:
I'm binding a CheckBoxlist below in the ItemDataBound(the CheckBoxList is in a Datalist) By doing "li.Selected = True" i can see all the checkBoxes are selected. But what i want is to be able...
4
by: Patrick.O.Ige | last post by:
I have a CheckBoxList in a DataList and i'm trying to get item Selected after doing a postBack. I have set my CheckBoxlist AutoPostBack="True" Any ideas what 'm doing wrong? It seems not to...
2
by: Patrick.O.Ige | last post by:
I have some boolean value(1 or 0 ) in a table and i want a databinded CheckBoxList to present the selected values on the page.. With CheckBox i know i can se the Checked property like so :-...
0
by: Jai | last post by:
Hi, Somebody please tell me how to bind(two way) a checkboxlist with objectdatasource if the checkboxlist is inside a formview..... Code of FormView is like this::--- <asp:FormView...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.