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 103457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:07:37+00:00 2026-05-11T01:07:37+00:00

I have table rows of data in html being filled from a CGI application.

  • 0

I have table rows of data in html being filled from a CGI application. I want each row to have a check box next to it so I can delete multiple rows, just like in gmail.

I figured out the basic text form and was able to send it to the CGI program to delete the row, but I don’t want to have to type in the row name to delete a single file at a time.

What does the code look like on both sides (html-browser and C-CGI app) for forms when you can select multiple deletions through check boxes? Is there an example somewhere? (I am limited to JS and HTML but I think JS is for validation anyway, don’t need that right now. C coding on the CGI app side.)

Thank You.

  • 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. 2026-05-11T01:07:38+00:00Added an answer on May 11, 2026 at 1:07 am

    Well, you could do it in a few ways:

    1) Have all elements in the same form. Name each checkbox the same but give each checkbox a value that distinguishes the record/id/file it represents. When the browser, if it is compliant, submits the form, the CGI app should be able to see the HTTP parameters as part of the POST or GET submission. Lots of CGI apps like PHP combine same-name parameters into an array. You can always walk the param list yourself with C as well.

    // Client side html <table> <form> <tr><td><input type='checkbox' name='id' value='1'/></td><td>Row 1</td></tr> <tr><td><input type='checkbox' name='id' value='2'/></td><td>Row 2</td></tr> <tr><td><input type='checkbox' name='id' value='3'/></td><td>Row 3</td></tr> <tr><td><input type='checkbox' name='id' value='4'/></td><td>Row 4</td></tr> </form> </table>  // Server side CGI, using pseudo-code String[] ids = request.getArrayOfParametersNamed('id'); if(!empty(ids)) {  for(id in ids) {    DatabaseControllerModelThingWhatever.deleteById(id);  }   // Actually if SQL based you should use a batch statement instead of   // one-at-a-time deletes like above }  // Ok the rows are deleted, either print out the page, or better yet, // send a redirect so that a user-refresh does not try and re-delete  // already deleted stuff and also give the user a wierd 'resubmit form' warning // Done 

    2) Using AJAX and preferrably some type of Javascript library, when user clicks delete, perform an ajax-based submission that submits a request to delete the checked records. Simultaneously use Javascript to remove the rows from the HTML table. This means the user’s page is never fully refreshed, well, sort of.

     // Client side HTML is same as before, only this time there is a DELETE button with  // an onclick handler. Also, add a 'class' or 'id' to each 'tr' so we can find it   // in the HTML table   // Pseudo-javascript because I am lazy  function onDeleteButtonClick() {    // Get our ids   var idElements = document.getElementsById('id');    // Submit an async AJAX request (e.g. use Jquery and send ids as URL params)   ajaxedDeleteSubmission(idElements);    // Delete all the rows that should not be there   for(i = 0; i < tablex.rows.length; i++) {    // Grab the value of the 'id' attribute of each table row (<tr id='?'>...</tr>)    id = tablex.rows[id].id;    if(id in ids) {     // Remove the row, forget how because now I just use Jquery.     tablex.deleteRow(i);    }   }  } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 118k
  • Answers 118k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer echo bin2hex($string); or: for ($i = 0; $i < strlen($string);… May 11, 2026 at 11:30 pm
  • Editorial Team
    Editorial Team added an answer Python with PyObjC installed (which is the case for Mac… May 11, 2026 at 11:30 pm
  • Editorial Team
    Editorial Team added an answer No, you're mistaken. Brute force attacks are one thing, but… May 11, 2026 at 11:30 pm

Related Questions

I have an AJAX application that downloads a JSON object and uses the data
I've got this little snippet that I use for row highlighting on an XSLT
When using an ASP.NET WebForms ListView control to display data in an HTML table
I have a table of paged data, along with a dynamically created pager (server-side

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.