js,jquery获取checkbox 记录ID值

function updateProcess()
  {
   var no = "";
   var checkednum = $("input:checked");
   var len = checkednum.length;
   for ( var i = 0; i < checkednum.length; i++) {
    if(checkednum[i].name == "selectall"){
     len--;
    }
    if (checkednum[i].checked)
     no = checkednum[i].value.split("|")[0];
   }
   if(len == 0){
    alert("请选择要操作的记录");   
   }else if(len > 1){
    alert("一次只能修改一条记录");
   }else{
    window.location.href = "pwmfjumpUpdateProcessName?id="+no;
   }
  }

js方法

 function activeDeptP(obj) {
 var count = 0;
 var userids = document.getElementsByName(obj);
 var str = ""
 var length = userids.length;
 for ( var i = 0; i < length; i++) {
  if (userids[i].checked) {
   str = str + userids[i].value + ",";
   count++;
  }
 }
 if (count == 0) {
  alert("请选择需要操作的记录!");
  return false;
 }
 if (count >1) {
  alert("一次只能选择一个激活!");
  return false;
 }
 var rr = confirm("确定激活?");
 if (rr == true) {
  window.location.href = "<%=basePath%>pwmfactiveOpen?ss=" + str;
 } else {
  return false;
 }
}

 

posted @ 2013-03-06 08:56  日月当空  阅读(6529)  评论(0编辑  收藏  举报