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

  • Home
  • SEARCH
  • 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 7869411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:18:40+00:00 2026-06-03T01:18:40+00:00

I’ve gone through a solution on processing checkboxes and think I understand what I

  • 0

I’ve gone through a solution on processing checkboxes and think I understand what I need to do, but I have a problem where I put my delete button in this code. Here is my table:

<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>
...

Notice that I loop through and populate the table from the server but the header is not looping through obviously. I used to put the delete button in the form and on each line of the table. But now since I want multi-delete I create checkboxes on each line and put the delete button in the header. I should also note that video_name is crucial so I know what videos to delete.

But that is the problem, since I don’t have a submit (delete) in the form (that is in the loop) I can’t process theses checkboxes. Instead I only have the delete button Can anyone suggest a better way to do this?

  • 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-03T01:18:42+00:00Added an answer on June 3, 2026 at 1:18 am

    The form should go around the whole table, and rather than have a hidden input for the name you can have it in the checkbox’s name:

    <input type="checkbox" name="radioselect[<?php echo $result_videos[$i]['video_name']; ?>]" />
    

    Then, in your PHP script that receives the POST request, $_POST['radioselect'] will be an array. You can then use:

    foreach(array_keys($_POST['radioselect']) as $k) { ... }
    

    This will loop through the selected checkboxes. You get the video_name in $k and you can handle it as you would a single deletion.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to loop through a bunch of documents I have to put
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I need to clean up various Word 'smart' characters in user input, including but
I have thousands of HTML files to process using Groovy/Java and I need to
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't

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.