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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:52:37+00:00 2026-05-23T04:52:37+00:00

I am displaying table rows in the form. Each row has 5 columns, one

  • 0

I am displaying table rows in the form. Each row has 5 columns, one of the columns is an (editable) textbox field.

ajaxLoading(true);
    $.post('<%=request.getContextPath()%>'+"/processServlet", postData,
            function(data) {
              var ctxPath='<%=request.getContextPath()%>';
                currentPosition = data.currentPosition;

                var items = $("#itemsTable");
                items.empty();
                if (data.items.length == 0) {
                    items.append($('<tr><td colspan=5 style="color:red;">No items<td></tr>'));
                }
                ;
                for (var i = 0; i < data.items.length; i++) {

                    editText = "";

                    items.append($("<tr " + zebra + "><td><a href=\"javascript: deviceView('" + data.items[i].id + "')\">" + data.items[i].num +
                            "</a></td><td>" + data.items[i].itemType +
            "</td><td><input type = 'checkbox' id = 'CheckBoxRow_' />" + data.items[i] +
                            "</td><td><input type = 'textbox' id = 'TextBoxRow_' value = '" + data.items[i].itemName +"' "/>" +
                            "</td><td>" + data.items[i].status +
                            "</td><td>" + data.items[i].date + "</td>" +
                           "<td>" + data.items[i].firmware + "<td>" +
                            "<a href=\"javascript: deleteItem('" + data.items[i].id + "')\">Delete</a>" +
                            "</tr>"));

                ;
                ajaxLoading(false);
            }, "json");

How do I auto select the check box when the data is entered or modified in the textbox and save the data in the database?

  • 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-05-23T04:52:37+00:00Added an answer on May 23, 2026 at 4:52 am

    bind to textbox onchange event and have it set the checkbox to checked=true once returned with a value (and not already checked).

    $('#itemsTable input[type="checkbox"]').change(function(e){
      var $cb = $(this);
      if ($cb.is(':checked')){
        $cb.closest('tr').find('input[type="checkbox"][id^=CheckBoxRow_]').prop('checked','true');
      }
    });
    

    basically. though you really should not use HTML in an append, and should be building the objects with jQuery.

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

Sidebar

Related Questions

I'm displaying a table with multiple rows and columns. I'm using a JQUERY plugin
I have an html table that is displaying customer orders. One of these columns
I have a stored proc that returns 4 rows in a table. Each row
I am displaying a scrolled data table in a web page. This table has
I am displaying the contents of a datetime field in mysql in a table
How would you go about displaying huge amount of rows in SWT table? Huge
I have an HTML <TABLE> displaying a list of items in the rows of
I have a html file which has a huge table with 4 columns and
I have a grid view displaying the messages a user has. Each message the
We have an MS Access 2007 database with a simple form displaying table data.

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.