用Jquery实现全选后能够执行被选中的checkbox脚本事件!
我的代码如下: 现在我实现了Checkbox 全选,但是一旦全选后我想执行被选上的脚本事件。 用Jquery实现!!!!
function checkAllstate(o) {
if (o.checked) {
$("input[id^=FeesShow_ctl10_chkSdate]").attr("checked", true);
}
else {
$("input[id^=FeesShow_ctl10_chkSdate]").attr("checked", false);
}
}
脚本事件如下:
function chkShowDropDown(sender, keyvalue) {
$("select[id$='ddl" + keyvalue + "']").each(
function() {
this.style.display = sender.checked ? "block" : "none";
}
);
$("[id$='lbl" + keyvalue + "']").each(function() {
this.style.display = sender.checked ? "none" : "block";
});
}
被全选的控件如下:
<asp:CheckBox ID="chkSdate1" runat="server" onclick="chkShowDropDown(this,'AirlineCompany');" />
<asp:CheckBox ID="chkSdate2" runat="server" onclick="chkShowDropDown(this,'AirlineCompany');" />
<asp:CheckBox ID="chkSdate3" runat="server" onclick="chkShowDropDown(this,'AirlineCompany');" />