Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > CheckBoxList Individual Item Detection

Reply
Thread Tools

CheckBoxList Individual Item Detection

 
 
=?Utf-8?B?UnlhbiBTY3VsbHk=?=
Guest
Posts: n/a
 
      06-23-2004
Hello I have problem with determining exactly what CheckBoxList element is selected using JavaScript code. When I databind to the checkboxlist it renders it on the page and instead of giving each checkbox a value, it gives it a name and does a <label> tag for the Text of the item, and has nothing about the value anywhere in the rendered code for the checkboxlist. So when I enumerate through the controls on the page in javascript, I can never access the value of the checkboxlist item so I don't know which one is selected. It seems to work with radiolists though, cause when asp.net names them it sets the value to the value you've databinded it, but it doesn't seem to do it with the checkboxlist. Anybody know why?
Thank You
Ryan
 
Reply With Quote
 
 
 
 
avnrao
Guest
Posts: n/a
 
      06-23-2004
Check for the item in the javascript before you set visible to true or
false.
if(document.all('youritemname'))
{
iterate;
}

hth,
Av.
"Ryan Scully" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello I have problem with determining exactly what CheckBoxList element is
> selected using JavaScript code. When I databind to the checkboxlist it
> renders it on the page and instead of giving each checkbox a value, it
> gives it a name and does a <label> tag for the Text of the item, and has
> nothing about the value anywhere in the rendered code for the
> checkboxlist. So when I enumerate through the controls on the page in
> javascript, I can never access the value of the checkboxlist item so I
> don't know which one is selected. It seems to work with radiolists
> though, cause when asp.net names them it sets the value to the value
> you've databinded it, but it doesn't seem to do it with the checkboxlist.
> Anybody know why?
> Thank You
> Ryan



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ClientIds for individual CheckBoxes in a CheckBoxList Nathan Sokalski ASP .Net 2 04-23-2009 01:48 AM
how do i get rid of border around individual checkbox in checkboxlist? TS ASP .Net Web Controls 5 08-10-2005 09:31 AM
How to get Selected item in a Databinded CheckBoxList when CheckBoxlist is in a DataList? Patrick.O.Ige ASP .Net 5 06-19-2005 06:11 AM
Change forecolor for individual listitems in CheckBoxList Eric Robishaw ASP .Net 1 12-27-2003 07:50 PM



Advertisments