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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:33:30+00:00 2026-06-05T22:33:30+00:00

I have the Demo Table which I can click on the cell(td tag) and

  • 0

I have the Demo Table which I can click on the cell(td tag) and I can change the value on it.direct php DataBase.
To do that I need to contain two tags.1 – span. 2 – input.
like the below.

<td class='Name'>
 <span id="spanName1" class="text" style="display: inline;"> Somevalue  </span>
 <input type="text" value="Somevalue" class="edittd" id="inputName1" style="display: none; ">   
</td>

To control the data inside the cell I use in jquery .mouseup function.
mouseup works but also makes trouble.
I need to replace it with blur function but when I try to replace mouseup with blur
the program does not work because, when I click on the cell I am able to enter the input tag and I can change the value but I am not successful in Leaving the tag/field by clicking out side the table, which alow me to update the DataBase
You can see the Demo with blur Here.
What do you advice me to do?

$(".edittd").mouseup(function() {
        return false;
    });
  //*************
    $(document).mouseup(function() {
        $('#span' + COLUME + ROW).show();
        $('#input'+ COLUME + ROW ).hide();
        VAL = $("#input" + COLUME + ROW).val();
        $("#span" + COLUME + ROW).html(VAL);

        if(STATUS != VAL){
            //******ajax code
                 //dataString = $.trim(this.value);
                      $.ajax({
                        type: "POST",
                         dataType: 'html',
                         url: "./public/php/ajax.php",
                         data: 'COLUME='+COLUME+'&ROW='+ROW+'&VAL='+VAL, //{"dataString": dataString}
                             cache: false,
                             success: function(data)
                             {
                                $("#statuS").html(data);
                                }
                             });
                      //******end ajax
                      $('#statuS').removeClass('statuSnoChange')
                        .addClass('statuSChange');
                         $('#statuS').html('THERE IS CHANGE');
                         $('#tables').load('TableEdit2.php');
                 }
                 else
                 {
                 //alert(DATASTRING+'status not true');
                 }
        });//End mouseup function

I change it to:

$(document).ready(function()
{
    var COLUMES,COLUME,VALUE,VAL,ROWS,ROW,STATUS,DATASTRING;
    $('td').click(function() {
        COLUME = $(this).attr('class');   
      });
//****************
    $('tr').click(function() {
        ROW = $(this).attr('id');
        $('#display_Colume_Raw').html(COLUME+ROW);
        $('#span' + COLUME + ROW).hide();
        $('#input'+ COLUME + ROW ).show();
      STATUS = $("#input" + COLUME + ROW).val();
    });
  //******************** 
    $(document).blur(function() {
        $('#span' + COLUME + ROW).show();
        $('#input'+ COLUME + ROW ).hide();
        VAL = $("#input" + COLUME + ROW).val();
        $("#span" + COLUME + ROW).html(VAL);

        if(STATUS != VAL){
            //******ajax code
                 //dataString = $.trim(this.value);
                      $.ajax({
                        type: "POST",
                         dataType: 'html',
                         url: "./public/php/ajax.php",
                         data: 'COLUME='+COLUME+'&ROW='+ROW+'&VAL='+VAL, //{"dataString": dataString}
                             cache: false,
                             success: function(data)
                             {
                                $("#statuS").html(data);
                                }
                             });
                      //******end ajax
                      $('#statuS').removeClass('statuSnoChange')
                        .addClass('statuSChange');
                         $('#statuS').html('THERE IS CHANGE');
                         $('#tables').load('TableEdit2.php');
                 }
                 else
                 {
                 //alert(DATASTRING+'status not true');
                 }
        });//End mouseup function
        $('#save').click (function(){
            var input1,input2,input3,input4="";
                input1 = $('#input1').attr('value');
                input2 = $('#input2').attr('value');
                input3 = $('#input3').attr('value');
                input4 = $('#input4').attr('value');
                $.ajax({
                    type: "POST",
                    url: "./public/php/ajax.php",
                    data: "input1="+ input1 +"&input2="+ input2 +"&input3="+ input3 +"&input4="+ input4,
                    success: function(data){
                        $("#statuS").html(data);
                        $('#tbl').hide(function(){$('div.success').fadeIn();});
                        $('#tables').load('TableEdit2.php');
                    }
                });
        });
});
  • 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-05T22:33:32+00:00Added an answer on June 5, 2026 at 10:33 pm

    The blur event does not fire when a user clicks around the document.

    To see when events fire, you can attach a logging function using your javascript console.
    Paste these in your console:

    $(document).mouseup(function(){console.log('document.mouseup()')});
    $(document).blur(function(){console.log('document.blur()')});
    

    Then click around and see that blur will not fire unless you the whole document loses focus (and not an all browsers).

    What kind of trouble was mouseup causing?

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

Sidebar

Related Questions

I have two columns(column1, column2) in my oracle database table named as demo .
I have this file 'gardens.php' , which pulls data from a table called 'generalinfo'
I have a jsfiddle here which you can use to see a basic demo
What I'm trying to do is have the user click a table which selects
I have a HTML Table which is similar to the one shown (demo.jpg) in
I have a demo site where users can log into the site and change
I have a table (id=deneme). I need to iterate through the td value, determine
I have a database with existing data that uses the datetime field which is
I have two Tablesorter tables in my website demo , which can be accessed
I generated a table demo of something similar to what I have on my

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.