...

View Full Version : script that allows you to delete multiple rows on data table



awayne96
12-04-2009, 04:19 AM
I need a script that would allow the user to click check boxes on more then one posting they have and click a button to delete them.

awayne96
12-09-2009, 04:42 AM
Anyone? I can't seem to find what I'm looking for.

Rowsdower!
12-09-2009, 02:34 PM
Were you planning to use something other than simple HTML and CSS for this? I believe so.

Think about that and then think about why it is that you have received no response so far in this part of the forum.

You might want to contact a moderator to get your thread moved to a more appropriate location to get better results.

gusblake
12-09-2009, 05:03 PM
This might help you:



<!DOCTYPE HTML PUBLIC "-//W3C// DTD HTML 4.//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="index.css">
<script type="text/javascript">
function deleteRows(table) {
var rows=table.getElementsByTagName("tr");
for(i=rows.length-1;i>=0;i--) {
var checkboxes=rows[i].getElementsByTagName("input");
var del=false;
if(checkboxes.length) {
del=checkboxes[0].checked;
if(del) rows[i].parentNode.removeChild(rows[i]);
}
}
}
</script>
</head>
<body>
<table id="table" width="200">
<tr>
<td>
delete
</td>
<td>
data
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="delete">
</td>
<td>
lorem ipsum 1
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="delete">
</td>
<td>
lorem ipsum 2
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="delete">
</td>
<td>
lorem ipsum 3
</td>
</tr>
</table>
<input type="button" onclick="deleteRows(document.getElementById('table'))" value="Delete">
</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum