jquery实现checkbox全选全不选(示例)
本文导语: 1,演示代码一 代码示例: jquery实现checkbox全选全不选_脚本学堂_http://www. function checkSubmit() { document.Search.submit(); } function fnull(){ var obj = document.getElementById("goPage"); var index = obj.selected...
1,演示代码一
jquery实现checkbox全选全不选_脚本学堂_http://www.
function checkSubmit() {
document.Search.submit();
}
function fnull(){
var obj = document.getElementById("goPage");
var index = obj.selectedIndex; // 选中索引
var text = obj.options[index].text; // 选中文本
var go = obj.options[index].value; // 选中值
//alert(go);
gopage(go);
}
function gopage(page){
var numberpg=document.getElementById("numberpg").value;
document.getElementById("prepage").value=numberpg;
document.getElementById("currPage").value=page;
checkSubmit();
}
function px(){
var numberpg=document.getElementById("numberpg").value;
gopage(1);
}
function driction(id){
document.s_result_form1.s_result_form1_id.value = id;
document.s_result_form1.submit();
}
$(function(){
$("td").css("height","22px");
$("#refresh").bind("click",function(){
//location.reload();
location="wlan!querySurveyWlan.do";
});
$(".dg_alternatingitemstyle").bind("mouseover",function(){
$(this).children().css("height","22px");
});
$(".dg_alternatingitemstyle").bind("mouseout",function(){
$(this).children().css("height","22px");
});
});
WLAN调查管理
记录日期:
热点类型:
上网类型:
手机号码:
地址建议:
${dto.recmakedate}
${dto.type}
${dto.onlinetype}
${dto.mobileno}
${dto.address}
第${currPage}页 | 共${countPage}页/${countNum}条记录
每页
100
300
500
条记录 | 第
${stu.count}
${stu.count}
页
当前查询没有数据!
$(function(){
});
function selectAll(){
var ck = $("input[name=ck]");
var currSelect = $("input[name=allSelect][checked]").val();
$.each(ck,function(i){
//alert(ck[i].disabled)
if(!ck[i].disabled){
ck[i].checked = currSelect;
}
});
}
function cancelCKSelect(){
var ck = $("input[name=ck]");
var r = true;
$.each(ck,function(i){
if(!ck[i].checked && !ck[i].disabled){
r=false;
return false;
}
});
$('#allSelect').attr('checked', r);
}
function deletes(){
var delId ="";
var ck = $("input[name=ck]");
$.each(ck,function(i){
if(ck[i].checked && !ck[i].disabled){
delId += "'"+$("#ckvalue"+i).val()+"',";
}
});
delId = delId.substring(0,delId.lastIndexOf(","));
if(delId != ""){
var flag = window.confirm("您确定删除吗?");
if(!flag){
return;
}
window.location= "wlan!hotDelete.do?hotWlanId="+delId;
}else{
alert('请选择需要删除的数据!');
}
}
2,演示代码二
check all
1
2
3
4
$("#ckAll").click(function() {
$("input[name='sub']").prop("checked", this.checked);
});
$("input[name='sub']").click(function() {
var $subs = $("input[name='sub']");
$("#ckAll").prop("checked" , $subs.length == $subs.filter(":checked").length ? true :false);
});