473,382 Members | 1,225 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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 1578
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John Mullen | last post by:
I want to take the following HTLM and use javascript to turn on radio buttons if checkbox is checked, can I do this with javascript (maybe onClick or an array) or do i need a server side script ?...
4
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi! How do I convert a CheckBox.Checked to an int? Regards Martin Arvidsson
6
by: AFN | last post by:
I want to click a checkbox and have a 4 line (approx) paragraph appear beneath the checkbox, pushing the rest of the page down. And when unchecking the checkbox, the paragraph should disappear...
4
by: Kevin | last post by:
Hi, I have a input with type checkbox. I want it to be automatically checked if the value from the corresponding field in the database is also checked. I tried this: <% set objdc =...
4
by: RodBillett | last post by:
I have a situation where I have 3 checkboxes - and at least 1 needs to be selected at all times... I have implemented the code that allows this behavior to happen, BUT Viewstate gets all messed...
0
by: yurps | last post by:
Hello I have a DataList like this <asp:DataList id="Questions" Runat="server"> <ItemTemplate> <table border="1"> <tr> <td> <asp:CheckBox ID="Yes" Runat="server"></asp:CheckBox> <input...
1
by: Patrick Olurotimi Ige | last post by:
I 'm databinding a CheckBoxList control Can somebody forward me a sample how to get if a checkBox is selected i want to return TRUE and if not FALSE? Thanks *** Sent via Developersdex...
6
by: rishabhshrivastava | last post by:
Hey All, Can someone suggest me a way to get the values of CheckBox(es) selected in a CheckBoxList control using JAVASCRIPT. I am pasting my current code gere but its not working need some...
3
by: nologo | last post by:
All, Have a problem i just cant find the answer for. I'm trying to populate a colum in a SQL database. Basically the column requires a 1 or 0. I'm trying to populate this col via a c#...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.