|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Getting the values of checkbox(es) checked in a checkboxlist using JavaScriptI 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 |
|||||||||||||||||||||||