PHP? ??? ?? ??? ??? ?? ??? ?????(3)
??? ??? ??? ?? ?? ???? ?? ??, ?? ??, ?? ?? ??? ? ?? ??? ????.
?? ??? ????, ?? ??? ?? ????, ??? ?? ?? ??? ????? ? ??? ?????.
?? <form> ??? name ??? ?????
<form id="frm" name="frm" method="post" action="" style="margin-bottom:3px;"></form>
name ??? <input>?? ?????.
<input type="checkbox" name="itm"/>
??? ? ?? ?? ?? ??? onclick ???? ?????.
<input type="button" value="選擇全部" onclick="selectAll()" /> <input type="button" value="取消全部" onclick="cancelAll()" /> <input type="button" value="刪除所選" onclick="del()" />
??????? ???? ?? ?? ???? ?? ??? ?????. ????? for ??? ???? ??? ?????.
?? ???? ??=true? ????? "?? ??"? ???? ?? ???? ??=false? ?? ????? "?? ??"? ?????.
????? ???? ??? ??? ID? ???? ?? ????. '?? ?? ??'? ???? ?? ???? ???? ?? ???? ???? ?????.
ID? ??? ???? ??? ?? ??, ??? ???? ??? ?? ????.
<script language="javascript"> function selectAll() //選中所有 { node=window.document.frm.itm; for(i=0;i<node.length;i++) { node[i].checked=true; } } function cancelAll() //取消選中所有 { node=frm.itm; for(i=0;i<node.length;i++) { node[i].checked=false; } } function del() //刪除選中的所有 { node=frm.itm; id=""; for(i=0;i<node.length;i++) { if(node[i].checked) { if(id=="") { id=node[i].value } else { id=id+","+node[i].value } } } if(id=="") { alert("您沒有選擇刪除項"); } else { location.href="?type=del&id="+id } } </script>