A very simple way is to write the name of the checkbox the same,
When you receive it, you will receive a string separated by a half-width ","
The split function is then separated into an array,
And then read out each array of data, delete.
This method is not really deleted together, but is deleted individually.
After the run, the data disappears together, yes,
But after a piece is deleted, the final result is displayed.
<script language= "JavaScript" >
<!--
function Checkall (form) {
for (Var i=0;i<form.elements.length;i++) {
var check = Form.elements[i];
if (check.name!= ' chk_all ') check.checked = form.chk_all.checked;
}
}
-->
</script>
<form method= "POST" action= "xxx.asp" name= "Test" >
<input type= "checkbox" Name= "Chk" value= "1" > select 1
<input type= "checkbox" Name= "Chk" value= "2" > select 2
<input type= "checkbox" Name= "Chk" value= "3" > select 3
<br><br>
<input type= "checkbox" Name= "Chk_all" value= "on" > I want to select all
</form>
The above is the front desk form.
Background Delete:
<%
id = request.form ("chk") ' will get a string separated by half corner ', '
IDS = Split (ID, ",")
For all AA in IDs
Conn.execute ("delete ... where id = AA")
Next
%>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service