日期:2014-05-16 浏览次数:20498 次
<script language="javascript" type="text/javascript"> function ChangeAllCheckStatus(objCheckBox, chkAllName,item) { if (objCheckBox.tagName == "INPUT" && objCheckBox.type == "checkbox") { var allInput = document.getElementsByName(item); for (var i = 0; i < allInput.length; i++) { if (allInput[i].type == "checkbox" && allInput[i].name != chkAllName) { allInput[i].checked = objCheckBox.checked; } } } } function IsSelectOne(chkAllName,item) { var allInput = document.getElementsByName(item); var count = 0; var argCarID = ""; for (var i = 0; i < allInput.length; i++) { if (allInput[i].type == "checkbox" && allInput[i].name != chkAllName ) { if(allInput[i].checked) { argCarID = argCarID + allInput[i].id + "|"; count++; } } } document.getElementById("hide_SelectedLCID").value = argCarID; return count; } function BatchUpdate() { var url = "LeaderCarPrintItem.aspx?LC_IDs=" + document.getElementById("hide_SelectedLCID").value; window.open(url,"window",""); return false; } function DaoChu() { if(IsSelectOne('chkAll') == 0) { alert('请选择一条记录'); return false; } else { return BatchUpdate(); } } </script>
<input id="CheckAll_Now" type="checkbox" name="CheckAll_Now" onclick="ChangeAllCheckStatus(this,'CheckAll_Now','CheckItem_Now');" />
<input id='<%#Eval("ID")%>' type="checkbox" name="CheckItem_Now"/>
[url=" onclick=]<img alt="" src="../../Content/Images/button02_21.gif" width="85" height="18" border="0" />[/url]
//其中getElementsByTagName方法要合理运用 script type="text/javascript"> var s=window.opener.condForm.ifShow.value;//得到父页面的标签值 if("set"!=s){ var selectElements= document.getElementsByTagName("select"); for(i=0;i<selectElements.length;i++){ selectElements[i].disabled=true; } var inputElements = document.getElementsByTagName("input"); for(i=0;i<inputElements.length;i++){ if(inputElements[i].type=="button"){ inputElements[i].disabled=true; }else{ inputElements[i].readOnly = "readonly"; } } window.opener.condForm.ifShow.value="set"; } </script>