469,578 Members | 1,863 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,578 developers. It's quick & easy.

CheckBoxList Individual Item Detection

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
Nov 18 '05 #1
1 1707
Check for the item in the javascript before you set visible to true or
false.
if(document.all('youritemname'))
{
iterate;
}

hth,
Av.
"Ryan Scully" <Ry********@discussions.microsoft.com> wrote in message
news:BE**********************************@microsof t.com...
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

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Robin Day | last post: by
4 posts views Thread by dm_dal | last post: by
4 posts views Thread by Shaul Feldman | last post: by
reply views Thread by Ryan Scully | last post: by
3 posts views Thread by Dune | last post: by
4 posts views Thread by Patrick.O.Ige | last post: by
reply views Thread by | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.