473,473 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Retrieving Label Values froma checkbox list

1 New Member
Hi

I have a checkbox list that I am trying to work through and get the label values for each checked item. I want the values all into one string.

This is what I have
Expand|Select|Wrap|Line Numbers
  1. function GetCheckboxValues
  2. {
  3.  var myCRMString;
  4.  
  5.         for (var n=0; n < document.forms[0].length; n++)
  6.         {
  7.             if (document.forms[0].elements[n].type=='checkbox')
  8.             {
  9.                 if (document.forms[0].elements[n].checked)
  10.                 {
  11.                     myCRMString = myCRMString +" "+ document.forms[0].elements[n].value;
  12.                 }
  13.             }
  14.         }
  15.  
  16.         document.write(myCRMString);
  17. }
  18.  
I know this only returns the value "On" when it runs, can anyone tell me how to get the label value.

Thanks in advance

Angela (New to programming)
Oct 27 '06 #1
1 5359
acoder
16,027 Recognized Expert Moderator MVP
Set the values of the checkboxes to the label values.
May 26 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Steve | last post by:
I'm not sure if I should be using tables here to structure the layout or if CSS is okay. I have a data entry form in which I have floated the labels to one side, and given them a specific width....
3
by: TR | last post by:
Is it possible with CSS to prevent this wrapping alignment with a checkbox with a nested label? This is the label of the checkbox that wraps beneath it I'd prefer it looked like...
0
by: Bryan Donaldson | last post by:
I have a table on my web form, declared like this: <asp:table id="tblOverrides" runat="server" enableviewstate=true" cssclass="clsTable"> <asp:tablerow cssclass="clsTblHeader"> <asp:tablecell ...
0
by: mroffey | last post by:
I have a problem where when I click on a checkbox in a datagrid, I want to get the associated label value. here is the code. foreach (DataListItem item in dlCategory.Items) { bool isChecked =...
3
by: Mike | last post by:
Need some help with passing a label to a subroutine. I have a form with lots of checkboxes. When the form loads i have a procedure that runs to lookup values and check the appropriate boxes. If the...
10
by: Girish | last post by:
Hi Everyone, I am passing a form to a php script for further processing. I am able to retrieve the last value set for that given form variable using $variable=$_REQUEST;
12
by: vbnewbie | last post by:
I am having problems accessing properties of dynamically generated objects in VB2005. Can someone please help? In a nutshell: My app creates an equal number of checkboxes and labels that share the...
3
by: coolprashh | last post by:
Hi Guys, I hope you can help me out with this .... its really urgent !! I am using PERL as the scripting language and WML as the formatting language as I am working on a WAP application. I...
0
by: cyberdawg999 | last post by:
Greetings all in ASP land I have overcome one obstacle that took me 2 weeks to overcome and I did it!!!!! I am so elated!! thank you to all who invested their time and energy towards helping me...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.