得到checkbox中的流水号,并把它存入hidden中或者Textbox中(分页中checkbox的选择与消选)

cs中:hickb.Attributes["onchange"] = "javascript:GetSnToHidden(this.id);" ;

function GetSnToHidden(textid)

{

 var checkbox=document.getElementById(textid);

var hdsn=document.getElementById('txtgooodssn');

var ifcheckedsn=checkbox.value+"," alert(ifcheckedsn);

if(checkbox.checked==true)

 {

   hdsn.value+=checkbox.value+","

}

else

{

   var deletedsn=hdsn.value;

   if(deletedsn.indexOf(ifcheckedsn)>=0)

  {

    deletedsn=deletedsn.replace(ifcheckedsn,'');

  }

  hdsn.value=deletedsn;

}

  alert(hdsn.value);

}

posted on 2010-08-20 15:47  jameshappy  阅读(299)  评论(0编辑  收藏  举报