Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7867381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:42:01+00:00 2026-06-03T00:42:01+00:00

I have an html table I’ve updated to use checkboxes to be able to

  • 0

I have an html table I’ve updated to use checkboxes to be able to delete multiple files:

<table>
    <thead>
    <tr>
        <th>Camera Name</th>
        <th>Date Created</th>
        <th>Video Size</th>
        <th>Video Length</th>
        <th>
            <button type="submit" class="deletebutton" name="delete_video" value="Delete" title="Delete the selected videos" onClick="return confirm('Are you sure you want to delete?')">Delete</button><br>
            <input type="checkbox" name="radioselectall" title="Select All" />
        </th>
    </tr>
    </thead>
    <tbody>

 <?php

for($i=0;$i<$num_videos;$i++)
{
       //do stuff
       //Note: I'm looping here to build the table from the server
?>              
        <tr >
            <td onclick="DoNav('<?php echo $url; ?>');">
                        <?php echo $result_videos[$i]["camera_name"]; ?> 
            </td>
            <td onclick="DoNav('<?php echo $url; ?>');">
                        <?php echo setlocalTime($result_videos[$i]["video_datetime"]); ?> 
            </td>
            <td onclick="DoNav('<?php echo $url; ?>');">
                        <?php echo ByteSize($result_videos[$i]["video_size"]); ?>
            </td>
            <td onclick="DoNav('<?php echo $url; ?>');">
                <?php echo strTime($result_videos[$i]["video_length"]); ?>
            </td>
            <td>
                <form name="myform" action="<?php echo htmlentities($_SERVER['REQUEST_URI']); ?>" method="POST">
                <input type="checkbox" name="radioselect" title="Mark this video for deletion"/>
                <input type="hidden" name="video_name" value="<?php echo $result_videos[$i]["video_name"]; ?>" />
                </form>
            </td>
        </tr>

I started with first creating some jquery code to create a select all/deselect all button in the table heading and just a test to show I can find which boxes are checked. That all works:

//selectall checkboxes - select all or deselect all if top checkbox is marked in table header
$("input[name='radioselectall']").change(function()
{
    if( $(this).is(':checked') )
    {
        $("input[type='checkbox']","td").attr('checked',true);
    } 
    else
    {
        $("input[type='checkbox']","td").attr('checked',false);
    }
});

//process checkboxes - which ones are on 
$(".deletebutton").click(function() {
    $("input[name='radioselect']:checked").each(function(i){
        alert(this.value);
    });
});

So the part where I’m stuck is I don’t know where to go from here. I need to pass all the video_names of all the videos selected (with the checkboxes). video_name is part of a hidden field in my form. So I need to pass that to my php function when the delete button is selected. Not really sure how to tackle this. Hope this makes sense.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:42:02+00:00Added an answer on June 3, 2026 at 12:42 am

    Simple solution maybe:

    Change your checkboxes to have a value of 1 and a name of $result_videos[$i][“video_name”]; in the table rows, make the form encapsulate the whole table.

    Then on submit you can do something like:

    foreach ($_POST as $key => $value) {
        //Delete $key (the name) where $value == 1
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a html table that looks something like this <table id=eventTable> <thead> <tr><th>#</th><th>Options</th></tr>
I have a HTML table like this: <table border=1> <tbody> <tr> <td><a href=# class=delete>DELETE
I have a HTML table like this: <table border=1> <tbody> <tr> <td><a href=# class=delete>DELETE
I have table [HTML Table] on page I want to delete record from table
I have a html table: Name Length Description x Name1 444 Blabd x.png Name2
I have an HTML table with various rows, each has a delete button with
I have an HTML table of data where each cell can have multiple lines
I have an html table like this below: name number contractid sebastian 01 aea123
I have a html table and I am trying to use the puff effect
i have a html table which looks like this: <table> <thead> <tr> <th >title1</th>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.