如何使用javascript计算checkboxlist的每个clcik上的单个复选框值? [英] how to count individual checkbox value on each clcik of checkboxlist using javascript?

查看:74
本文介绍了如何使用javascript计算checkboxlist的每个clcik上的单个复选框值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨......



i在gridview中有一个复选框列表...此复选框列表中有三个值..

1> ; day1

2> day2

3> day3



每个clcik of checkboxlist,我想得到每个值的总数选择使用javascript ...

并想要显示一个消息...



例如:当我选择day1,msg将显示1为day1选择;

但是当我再次选择day1时,它将显示2为day1选择;

i想要就像这个..



请帮帮我...

hi...

i have a checkboxlist in a gridview...there are three values in this checkboxlist..
1>day1
2>day2
3>day3

on each clcik of checkboxlist,i want to get the total select no of each value using javascript...
& want to show a msg...

for eg:when i select day1,msg will show "1 selected for day1";
but when i again select day1,then it will show "2 selected for day1";
i want just like this..

please help me out...

推荐答案

这两个都很清楚,很容易。您可以使用jquery操作相同类型的所有项目(复选框)或相同或相似的名称或ID。然后你可以总结一下它们中有多少被检查。
This is both very clear, and very easy. You can use jquery to operate on all items of the same type ( check boxes ) or of the same or similar name or id. Then you can sum up how many of them are checked.


这篇关于如何使用javascript计算checkboxlist的每个clcik上的单个复选框值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆