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

  • Thread starter Thread starter haresh.amis
  • Start date Start date
H

haresh.amis

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.Chkboxlist);
for (var i=0; i<frm.Chkboxlist.items.count-1;i++)
{
alert('i=' + i);
if(frm.Chkboxlist.items.checked)
{
alert(str);
str = frm.Chkboxlist.selecteditems + ' ';
}
}

Hope for quick reply

you can mail me on
(e-mail address removed)
thanks
 
var count = 0;
var els = document.getElementsByTagName('input');
for (var i=0; i < els.length; ++i)
{
var e = els;
if (e.type == 'checkbox'
&& e.name == '<%=ChkBoxList.UniqueID%>'
&& e.checked)
++count;
}

-- bruce (sqlwork.com)
 
var count = 0;
var els = document.getElementsByTagName('input');
for (var i=0; i < els.length; ++i)
{
var e = els;
if (e.type == 'checkbox'
&& e.name == '<%=ChkBoxList.UniqueID%>'
&& e.checked)
++count;

}

-- bruce (sqlwork.com)



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.Chkboxlist);
for (var i=0; i<frm.Chkboxlist.items.count-1;i++)
{
alert('i=' + i);
if(frm.Chkboxlist.items.checked)
{
alert(str);
str = frm.Chkboxlist.selecteditems + ' ';
}
}
Hope for quick reply
you can mail me on
(e-mail address removed)
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?(keep in
mind that i m not using array for filling checkboxlist)
I have already use for this like checkboxlist.count ( but it's not
work)
have you any example for this?
pls help me ASAP

thanks
 
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


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

}

-- bruce (sqlwork.com)



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.Chkboxlist);
for (var i=0; i<frm.Chkboxlist.items.count-1;i++)
{
alert('i=' + i);
if(frm.Chkboxlist.items.checked)
{
alert(str);
str = frm.Chkboxlist.selecteditems + ' ';
}
}
Hope for quick reply
you can mail me on
(e-mail address removed)
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?(keep in
mind that i m not using array for filling checkboxlist)
I have already use for this like checkboxlist.count ( but it's not
work)
have you any example for this?
pls help me ASAP

thanks
 
Back
Top