opener checkbox radio attr

来源:互联网 发布:淘宝限时特价怎么设置 编辑:程序博客网 时间:2024/05/21 10:03

$(function(){
 $("img[src*=borrow.gif]").attr({style:"cursor:pointer",width:16,height:16});
 $("img[src*=detail.gif]").attr({style:"cursor:pointer",width:16,height:16});
 $("img[src*=button_03.gif]").click(
  function(){ 
   ocwindow("add.htm","添加空白证件",800,768);
  }
 );
 $("img[src*=button_05.gif]").click(
  function(){ 
   if($(":checkbox:checked").length==0)
    alert("请先选择后再删除!");
   if(confirm("确定要删除这吗?"))
   {
    $(":checkbox:checked").each(
     function(){
      if($(this).attr('name')=='kbzj'){
       $(this).parent().parent().hide();//remove()
      }
     }
    );
   }
  }
 );
 $("img[src*=detail.gif]").click(
  function(){ 
   ocwindow("detail.htm","证件领用情况",800,768);
  }
 );
 $("img[src*=borrow.gif]").click(
  function(){ 
   ocwindow("borrow.htm","证件领用",800,768);
  }
 );
 $("#checkall").click(
  function(){
   if($("#checkall").attr('checked'))
    $(":checkbox").each(
     function(){
      if($(this).attr('name')=='kbzj')
       $(this).attr('checked',true);
     }
    );
   else
    $(":checkbox").each(
     function(){
      $(this).attr('checked','');
     }
    );
  }
 );
});

 

 

$(function(){
  var i=0;
  $("button[value*=领 用]").click(
   function(){
    i=i+1;
    $("#tablelist").after("<tr onmouseover=/"this.bgColor='#f6faf9'/" onmouseout=/"this.bgColor='#ffffff'/" bgcolor=/"#ffffff/"><td width=/"5%/" align=/"center/" valign=/"middle/"><input type=/"checkbox/" name=/"checkbox/" value=/"checkbox/" /></td><td align=center>"+i+"</td align=center><td>&nbsp;</td><td align=center>&nbsp;</td><td  align=center>&nbsp;</td><td>&nbsp;</td></tr>");
  }
 );
});

 

 

var strtext="";
function add_expense()
{
 if($(":radio:checked").length<6)
  alert("还有费用、其它情况没有说明!");
 else{
  if($("#txt").attr("value").length>0)
   if(strtext.length>0)
    strtext=strtext.replace('其它:无',"其它:"+$("#txt").attr("value"));
  opener.expense.value=$.trim(strtext);
  window.close();
 }
}
$(function(){
$(":radio").click(
 function(){
  //alert("hello")
  var tzarray=new Array();
     var pcarray=new Array();
  var wfarray=new Array();
  
  $(":radio:checked").each(
       function(){    
       var strtype=(this.value).substring(0,2);           
       switch(strtype){
        case 'tz':
         tzarray.push((this.value).substring(2));
         break;
        case 'pc':
         pcarray.push((this.value).substring(2));
         break;
     case 'wf':
         wfarray.push((this.value).substring(2));
         break;
        default:
         alert("error!");
       }
      }
  );
  
  var strtz;  /*团组单位*/
  var strpc;  /*派出单位*/
  var strwf;  /*外方负担*/
  var strout="";
  if(tzarray.length>0){
   strtz="【我方团组单位负担】"+tzarray.toString();
   strout=strout+strtz;
  }
  if(pcarray.length>0){
   strpc=" 【我方派出单位负担】"+pcarray.toString();
   strout=strout+strpc;
  }
  if(wfarray.length>0){
   strwf=" 【外方负担】"+wfarray.toString();
   strout=strout+strwf;
  }
  
  //$("#txt").attr('value',$.trim(strout));
  strtext=$.trim(strout);
    }
);
})