<!-- 加个form标签,用于提交删除所用 -->
<form method="post" action="本页.php">
<label>
<input type="checkbox" name="id[]" value="<?php echo $rs['id'];?>" />
</label>
<div>
<input type="button" value="全选" onClick="selectBox('all')" />
<input type="button" value="反选" onClick="selectBox('reverse')" />
<input type="submit" name="btnSave" value="删除" />
</div>
</form>
<script type="text/javascript">
function selectBox(selectType){ //全选、反选
var checkboxis = document.getElementsByName("id[]");
if(selectType == "reverse"){ //反选
for (var i=0; i<checkboxis.length; i
原生PHP列表选项批量删除并同时删除上传图片
最新推荐文章于 2024-07-14 00:26:17 发布