CheckBoxList Individual Item Detection

G

Guest

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
 
A

avnrao

Check for the item in the javascript before you set visible to true or
false.
if(document.all('youritemname'))
{
iterate;
}

hth,
Av.
 

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

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top