---
title: "批量选择，删除(还未实现)"
author: "qsxinyu"
date: "2010-08-24T17:51:56Z"
tags: ["JSP"]
categories: ["Web前端"]
slug: "untitled"
draft: false
lastmod: "2010-08-24T17:51:56Z"
id: 746225
url: "https://qsxinyu.iteye.com/blog/746225"
---

需要配合对应的action进行数据库的操作。

删除按钮

```
<input type="button"  name="del" value="删除已选" onclick='toDelete()'/>
```

 批量选择之后，删除的JS函数

```
function toRemove() {
		var multiUserBox = document.forms[0].elements("deleteIds");
		var sign = 0;
		if (multiUserBox != null) {
			if (typeof (multiUserBox.length) != "undefined") {
				for ( var i = 0; i < multiUserBox.length; i++) {
					if (multiUserBox[i].checked == true) {
						sign = sign + 1;
					}
				}
			} else {
				sign = multiUserBox.checked;
			}
			if (sign == 0) {
				alert("请选中要删除的元数据");
			} else {
				if (window.confirm("您确认要删除选定的元数据吗?")) {

					document.forms[0].action = "capitalStructure.do?operFlag=delete";
					 parent.frames['mainframe'].location="/eblms/ci/peerAccountInfoBlank.jsp";  
					document.forms[0].submit();
				}
			}
		}
	}
```