469,590 Members | 2,254 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Getting the values of checkbox(es) checked in a checkboxlist

Hi All,
I am using CallBack feature in ASP.NET 2.0 and I am running into a
problem with checkboxlist control.

I have to find out which checkboxes are checked and get their values at
client-side(using JavaScript) but always I get a value
"undefined"....this code works for all other controls except
checkboxlist and radiobuttonlist controls. I am pasting my code below
Please let me know wht am i doing wrong.

At Server Side:-
chkBoxList.Attributes.Add("onclick", "UseCallBack('" &
chkBoxList.UniqueID & "');")

At ClientSide:-
function UseCallBack(cntrlName)
{
var cntrlID = cntrlName.split("$") ;
var cntrlValue = listValues(cntrlName);
var cntrlNameValue = cntrlID + '~' + cntrlValue;
GetCallBack(cntrlNameValue, "");

}

function listValues(objectName)
{
var list = null;
for (var i=0; i<objectName.length;i++){
if (document.getElementById(objectName[i]).checked)
{
list += objectName[i].value + ',';
}
}
return list;
}

After the Values are determined I am grabbing the values on
ServerSide's RaiseCallBack Event method.
Please Help!!!!

Thanks

Jul 28 '06 #1
2 1480
I am still struggling with this problem.......... any ideas???

Jul 31 '06 #2
See this at: http://aspnet.4guysfromrolla.com/articles/050703-1.aspx
Patrick

<ri****************@gmail.comwrote in message
news:11**********************@s13g2000cwa.googlegr oups.com...
>I am still struggling with this problem.......... any ideas???

Aug 1 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by John Mullen | last post: by
4 posts views Thread by Visual Systems AB \(Martin Arvidsson\) | last post: by
4 posts views Thread by RodBillett | last post: by
1 post views Thread by Patrick Olurotimi Ige | last post: by
6 posts views Thread by rishabhshrivastava | last post: by
3 posts views Thread by nologo | 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.