我的代码如下: 现在我实现了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');" />
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');" />
解决方案 »
- 求下面代码的解释
- 求救!js问题,FF下正常,IE不正常!
- javascript生成动态表格
- JAVASCRIPT 做的WEB打印能否打印表格内带有图像 ?
- window.open一个站点页面(改页面不是本站的),如何判断是否打开完毕并执行一个动作
- 如何用JAVASCRIPT获取当前窗口的高度和宽度?
- 再次提问,关于取得form里<input>和<select>对象集合数量的方法~~~~
- 同步歌词、视频、兼容Real、Wmp所有格式、可全屏播放、论坛插件网页播放器,一旦拥有,别无所求!
- 关于disabled的问题
- 怎样用js实现把网页上的图保存到本地,路径程序中指定,不出现另存的对话框
- 获取A标签的ID值,大侠们帮帮忙
- 缺少对象的问题。。。。
$("input[id^=FeesShow_ctl10_chkSdate]").each(function(){
$(this).attr("checked", o.checked);
chkShowDropDown(this,'AirlineCompany');
});
}
function checkAllstate1(o) { $("input[id^=FeesShow_ctl10_chkSdate]").each(function() {
$(this).attr("checked", o.checked);
chkShowSpan(this, 'Sdate');
chkShowSpan(this, 'Edate');
chkShowtable(this, 'CB');
chkShowDropDown(this, 'AirlineCompany');
chkShowDropDown(this, '_rateType');
chkShowDropDown(this, 'Dptype');
chkShowDropDown(this, 'VoyageType');
chkShowtextarea(this, 'SE');
chkShowtextarea(this, 'EE');
chkShowtextarea(this, 'AircomE');
chkShowtextarea(this, 'NoAircomE');
chkShowtextarea(this, 'Cabin2');
chkShowCloum(this, 'Discount');
chkShowCloum(this, 'RewardDiscount');
chkShowCloum(this, 'PolicyType');
})
$("input[id$='txt" + keyvalue + "']").each(function() {
this.style.display = sender.checked ? "block" : "none";
});
$("[id$='lbl" + keyvalue + "']").each(function() {
this.style.display = sender.checked ? "none" : "block";
});
} 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";
});
}
function chkShowtextarea(sender, keyvalue) {
$("textarea[id$='txt" + keyvalue + "']").each(function() {
this.style.display = sender.checked ? "block" : "none";
});
$("[id$='lbl" + keyvalue + "']").each(function() {
this.style.display = sender.checked ? "none" : "block";
});
} function chkShowSpan(sender, keyvalue) {
$("span[id$='txt" + keyvalue + "']").each(function() {
this.style.display = sender.checked ? "block" : "none";
})
$("[id$='lbl" + keyvalue + "']").each(function() {
this.style.display = sender.checked ? "none" : "block";
}) }
function chkShowtable(sender, keyvalue) {
$("table[id$='" + keyvalue + "']").each(function() {
this.style.display = sender.checked ? "block" : "none";
})
$("[id$='lbl" + keyvalue + "']").each(function() {
this.style.display = sender.checked ? "none" : "block";
}) }
function checkAllstate1(o) { $("input[id^=FeesShow_ctl10_chkSdate]").each(function() {
$(this).attr("checked", o.checked);
chkShowSpan(this, 'Sdate');
chkShowSpan(this, 'Edate');
chkShowtable(this, 'CB');
chkShowDropDown(this, 'AirlineCompany');
chkShowDropDown(this, '_rateType');
chkShowDropDown(this, 'Dptype');
chkShowDropDown(this, 'VoyageType');
chkShowtextarea(this, 'SE');
chkShowtextarea(this, 'EE');
chkShowtextarea(this, 'AircomE');
chkShowtextarea(this, 'NoAircomE');
chkShowtextarea(this, 'Cabin2');
chkShowCloum(this, 'Discount');
chkShowCloum(this, 'RewardDiscount');
chkShowCloum(this, 'PolicyType');
})
} <asp:CheckBox ID="chkSdate0" name="jquerys[]" runat="server" onclick="chkShowSpan(this,'Sdate');" />
<asp:CheckBox ID="chkSdate1" name="jquerys[]" runat="server" onclick="chkShowSpan(this,'Edate');" />
<asp:CheckBox ID="chkSdate2" name="jquerys[]" runat="server" onclick="chkShowtable(this,'CB');" />
<asp:CheckBox ID="chkSdate3" name="jquerys[]" runat="server" onclick="chkShowDropDown(this,'AirlineCompany');" />
<asp:CheckBox ID="chkSdate4" name="jquerys[]" runat="server" onclick="chkShowDropDown(this,'VoyageType')" />
<asp:CheckBox ID="chkSdate5" name="jquerys[]" runat="server" onclick="chkShowtextarea(this,'SE');" />
<asp:CheckBox ID="chkSdate6" name="jquerys[]" runat="server" onclick="chkShowtextarea(this,'EE');" />
<asp:CheckBox ID="chkSdate7" name="jquerys[]" runat="server" onclick="chkShowtextarea(this,'AircomE');" />
<asp:CheckBox ID="chkSdate8" name="jquerys[]" runat="server" onclick="chkShowtextarea(this,'NoAircomE');" />
<asp:CheckBox ID="chkSdate9" name="jquerys[]" runat="server" onclick="chkShowtextarea(this,'Cabin2');" />
<asp:CheckBox ID="chkSdate10" name="jquerys[]" runat="server" onclick="chkShowCloum(this,'Discount');" />
<asp:CheckBox ID="chkSdate11" name="jquerys[]" runat="server" onclick="chkShowCloum(this,'RewardDiscount');" />
<asp:CheckBox ID="chkSdate12" name="jquerys[]" runat="server" onclick="chkShowDropDown(this,'Dptype');" />
<asp:CheckBox ID="chkSdate13" name="jquerys[]" runat="server" onclick="chkShowCloum(this,'PolicyType');" />
<asp:CheckBox ID="chkSdate14" name="jquerys[]" runat="server" onclick="chkShowDropDown(this,'_rateType');" />