Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Oct 2009
    Posts
    70
    Thanks
    6
    Thanked 0 Times in 0 Posts

    script that allows you to delete multiple rows on data table

    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.

  • #2
    New Coder
    Join Date
    Oct 2009
    Posts
    70
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Anyone? I can't seem to find what I'm looking for.

  • #3
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    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.
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • #4
    Regular Coder
    Join Date
    Jan 2006
    Posts
    568
    Thanks
    6
    Thanked 84 Times in 84 Posts
    This might help you:

    Code:
    <!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>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •