473,761 Members | 9,480 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how can i count checked check box in checkboxlist by java script? hlp me

hello to all,

I m using .net 2.0 and i face a problem that is as under
Well I have a checkboxlist which i bound in .cs page
now I want to count that how many checkboxes ate checked ( In
javascript ) and
checked checkboxes text will be concat and that string will be pass on
to report query

I m trying on by this code but it's not work
so have you great mind and great idea for this then pls tell me.
Code:
which I refere for count checked checkboxes

alert(frm.Chkbo xlist);
for (var i=0; i<frm.Chkboxlis t.items.count-1;i++)
{
alert('i=' + i);
if(frm.Chkboxli st.items.checke d)
{
alert(str);
str = frm.Chkboxlist. selecteditems + ' ';
}
}

Hope for quick reply

you can mail me on
ha***********@y ahoo.co.in
thanks

Apr 18 '07 #1
4 22849
<ha*********@gm ail.comwrote in message
news:11******** *************@e 65g2000hsc.goog legroups.com...
I m trying on by this code but it's not work
In what way is it not working...?
Apr 18 '07 #2

var count = 0;
var els = document.getEle mentsByTagName( 'input');
for (var i=0; i < els.length; ++i)
{
var e = els[i];
if (e.type == 'checkbox'
&& e.name == '<%=ChkBoxList. UniqueID%>'
&& e.checked)
++count;
}

-- bruce (sqlwork.com)
ha*********@gma il.com wrote:
hello to all,

I m using .net 2.0 and i face a problem that is as under
Well I have a checkboxlist which i bound in .cs page
now I want to count that how many checkboxes ate checked ( In
javascript ) and
checked checkboxes text will be concat and that string will be pass on
to report query

I m trying on by this code but it's not work
so have you great mind and great idea for this then pls tell me.
Code:
which I refere for count checked checkboxes

alert(frm.Chkbo xlist);
for (var i=0; i<frm.Chkboxlis t.items.count-1;i++)
{
alert('i=' + i);
if(frm.Chkboxli st.items.checke d)
{
alert(str);
str = frm.Chkboxlist. selecteditems + ' ';
}
}

Hope for quick reply

you can mail me on
ha***********@y ahoo.co.in
thanks
Apr 18 '07 #3
On Apr 18, 8:37 pm, bruce barker <nos...@nospam. comwrote:
var count = 0;
var els = document.getEle mentsByTagName( 'input');
for (var i=0; i < els.length; ++i)
{
var e = els[i];
if (e.type == 'checkbox'
&& e.name == '<%=ChkBoxList. UniqueID%>'
&& e.checked)
++count;

}

-- bruce (sqlwork.com)

haresh.a...@gma il.com wrote:
hello to all,
I m using .net 2.0 and i face a problem that is as under
Well I have a checkboxlist which i bound in .cs page
now I want to count that how many checkboxes ate checked ( In
javascript ) and
checked checkboxes text will be concat and that string will be pass on
to report query
I m trying on by this code but it's not work
so have you great mind and great idea for this then pls tell me.
Code:
which I refere for count checked checkboxes
alert(frm.Chkbo xlist);
for (var i=0; i<frm.Chkboxlis t.items.count-1;i++)
{
alert('i=' + i);
if(frm.Chkboxli st.items.checke d)
{
alert(str);
str = frm.Chkboxlist. selecteditems + ' ';
}
}
Hope for quick reply
you can mail me on
haresh_can...@y ahoo.co.in
thanks- Hide quoted text -

- Show quoted text -
thanks for quick reply me

Still I face this problem

I once again repeat my problem

I want to count that how manycheckboxes are checked in the
checkboxlist
the checkboxlist is run time filled (by Data binding)
I can not track or count that how many checkboxes are there
can you tell me how can i refere checkbox of a checkboxlist?(k eep in
mind that i m not using array for filling checkboxlist)
I have already use for this like checkboxlist.co unt ( but it's not
work)
have you any example for this?
pls help me ASAP

thanks

Apr 20 '07 #4
Surely, if you are binding it at run time, then you should now how many rows
you are binding to it... Can't you count the rows here?

Alternatively, do the count in the ondatabind of the checkboxes...

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
<ha*********@gm ail.comwrote in message
news:11******** **************@ o5g2000hsb.goog legroups.com...
On Apr 18, 8:37 pm, bruce barker <nos...@nospam. comwrote:
>var count = 0;
var els = document.getEle mentsByTagName( 'input');
for (var i=0; i < els.length; ++i)
{
var e = els[i];
if (e.type == 'checkbox'
&& e.name == '<%=ChkBoxList. UniqueID%>'
&& e.checked)
++count;

}

-- bruce (sqlwork.com)

haresh.a...@gm ail.com wrote:
hello to all,
I m using .net 2.0 and i face a problem that is as under
Well I have a checkboxlist which i bound in .cs page
now I want to count that how many checkboxes ate checked ( In
javascript ) and
checked checkboxes text will be concat and that string will be pass on
to report query
I m trying on by this code but it's not work
so have you great mind and great idea for this then pls tell me.
Code:
which I refere for count checked checkboxes
alert(frm.Chkbo xlist);
for (var i=0; i<frm.Chkboxlis t.items.count-1;i++)
{
alert('i=' + i);
if(frm.Chkboxli st.items.checke d)
{
alert(str);
str = frm.Chkboxlist. selecteditems + ' ';
}
}
Hope for quick reply
you can mail me on
haresh_can...@y ahoo.co.in
thanks- Hide quoted text -

- Show quoted text -

thanks for quick reply me

Still I face this problem

I once again repeat my problem

I want to count that how manycheckboxes are checked in the
checkboxlist
the checkboxlist is run time filled (by Data binding)
I can not track or count that how many checkboxes are there
can you tell me how can i refere checkbox of a checkboxlist?(k eep in
mind that i m not using array for filling checkboxlist)
I have already use for this like checkboxlist.co unt ( but it's not
work)
have you any example for this?
pls help me ASAP

thanks

Apr 20 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9864
by: jayuya | last post by:
How can i check in java script if a asp.net radio button list server control is selected? I have some custom javascript function in the client side that needs to run but I don't see the way to see if user selected or not one of the options.... thanks, jayuya
6
1915
by: Daniel Walzenbach | last post by:
Hi, I have an application using "Forms authentication". Everything works perfectly well except when I try to open a new page with java script like the following: <script language='javascript'>window.open (myPage.aspx','','Fullscreen=no; Scrollbars=yes; Menubar=no; Locationbar=no; Resizable=yes; Status=no;') </script>
34
3325
by: kpg | last post by:
Hello all, I have an asp.net web application with tons of Java script files. I would like to protect the Java Script somehow so it can't be seen by a remote user. I found several 3rd party solutions, but I thought I remember that there was a way to 'compile' java script and use that instead of the actual script?
33
9950
by: patrick_woflian | last post by:
hey guys, im just writing a basic calculation at the moment, before building on it for an A-Level piece of work. i can add/divide etc... two numbers together yet i am having a major problem with the following calculation: z = x! / (x- y)! The following code is my attempt and i was hoping for a point in the right direction as too where i am going wrong.. cheers
15
5903
by: webstormcomputers | last post by:
I'm trying to update a hidden field with java script and I'm only getting one of the values from my select stament. Here is the code below. <select name="on0"> <option value="25">25 <option value="50">50 </select> <script language="javascript"> document.write('<input type="hidden" name="amount"'); if (document.test.on0.options.value
1
4545
by: ilaxi kandoliya | last post by:
Hi, I have developing project with asp.net 2.0 (C#) I have used java script function in my code but if User's browser is java script disable then its not working properly so how to check Browser is java script enable or not and how to restrict user to view java script include page if its browser javascript disable until he not change accordingly. It is urgent Thanks in advance.. Ilaxi
9
1711
by: Tuy Solang | last post by:
I download four scripts that are used to display Khmer PGN for Khmer Chess. It works fine with Netscape 7.1 on MS Millenium, but it gave me an error(Java Script console) with Netscape 8.1 on MS XP. Here is the line : var pat_piece=/(\w{2}+)-(\w{2,3})/; I am familiar with C, but I have no clue with the above expression. Can someone help me to explain this expression?
2
6969
by: darkminos | last post by:
Hi, I have the following code int countCheckState = 0 for (int i = 0; i < CheckboxList.Count; i++) { if (CheckboxList.Checked) countCheckState++ if (countCheckState == 0)
5
3780
by: usha535140 | last post by:
Hi, In the intial page I want to dispay a check box ie for the first time I should display the page with check box ,If the check box is checked i need to dispaly the tabcontainer with the tabs.If it is unchecked It should nt display any thing. I tried the following apporach : in aspx page for all the tabs of the container I used Enabled="false" later in the java script method I used set_Enabled(true) for all the tabs, with this am...
0
10115
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9957
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7332
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6609
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5229
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5373
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3881
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 we have to send another system
3
3456
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2752
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.