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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:32:28+00:00 2026-05-21T07:32:28+00:00

I have a checkbox on a webpage that when you click it, updates the

  • 0

I have a checkbox on a webpage that when you click it, updates the value in the database as well as the editedBy and editedDate columns in a table in the database. I am doing the update via an ajax call to a php page. I am trying to get the updated editedDate and editedBy data in the callback on success so i can update the sorresponding span tags that hold this information. I’m trying to use jQuery to accomplish this. This is what i have so far:

var updateUserDate = function(data){
    var table = data.table;
    var rowId = data.rowId;
    var editedDate = data.editedDate;
    var editedBy = data.editedBy;
    //alert(table+' - '+rowId+' - '+editedDate+' - '+editedBy);
    $('"#'+table+' .row'+rowId+' .newEditedDate"').html('"'+editedDate+'"');
}
var submitDataCheckbox = function(target){
    var project = target.attr('project');
    var tableName = target.attr('table');
    var rowId = target.attr('rowId');
    var checkboxValue = (target.attr('checked'))?true:false;
    $.ajax({
        type: 'GET',
        url: '/checklistpost.php?projectId='+project+'&table='+tableName+'&rowId='+rowId+'&value='+checkboxValue,
        success: function(data){
            updateUserDate(data);
        },
        error: function(){
            alert('There was an error submitting data to the database.');
        },
        dataType: 'json'
    }); 
}

The checklistpost.php page takes the variables that are in the query string and posts them to the database. It also then puts the variables in an array which is then encoded in json so that i have a json object to work with. Basically, i am trying to take that json object that gets called back and use it to update the span as mentioned above. When i have used an alert() inside of the updateUserDate function before to verify that i can see the variables and they all have the right data (you can see the code i used to do this is commented out). However, whenever i try and use the variables with jQuery as you see on the 6th line of the code. It doesn’t do anything. BTW, The jQuery code that should be output based on what is written above should look like this $("#tableName .row1 .newEditedDate").html("April 14, 2011 @ 5:15pm") What am i missing? Thanks in advance for any help!

  • 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-21T07:32:28+00:00Added an answer on May 21, 2026 at 7:32 am

    Your selector is broken, you’ve got extra quotes in there:

    '"#' + table+' .row' + rowId + ' .newEditedDate"'
    

    should be:

    '#' + table + ' .row' + rowId + ' .newEditedDate'
    

    So:

    // you're surrounding editedDate with extra quotes too, or is that intentional?
    $('#' + table + ' .row' + rowId + ' .newEditedDate').html(editedDate);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a checkbox in GridViewColumn which i use for show/change database value. The
I want my website to have a checkbox that users can click so that
I have a checkbox list control on my asp.net web form that I am
T have used checkbox column in gridview. On click of a linkbutton, it should
I have used checkbox column in gridview. I want to check status of that
I have a gridview that I have added a checkbox column using a templatefield
I have a data grid that has a checkbox item renderer in a cloumn
I have a boolean variable value stored in an SQL Server database. This is
I have a webpage form with a checkbox on it. I am trying to
i have many checkbox: <input type=checkbox name=checkbox_user value = 1/> <input type=checkbox name=checkbox_user value

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.