473,397 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

editable table...fields not editable after first change

1
I'm using the following code to make fields in a table editable. Everything is working fine except that once a field is changed, the field is no longer clickable and the edit box will not reappear until the page is reloaded.

Expand|Select|Wrap|Line Numbers
  1.  
  2. <script type="text/javascript" src="http://ajax.googleapis.com/
  3. ajax/libs/jquery/1.5/jquery.min.js"></script>
  4. <script type="text/javascript">
  5. $(document).ready(function()
  6. {
  7.         $(".edit_td").click(function()
  8.         {
  9.                 var i=$(this).attr('id');
  10.                 $("#jan_"+i).hide();
  11.                 $("#jan_input_"+i).show();
  12.         }).change(function()
  13.         {
  14.                 var clientID="<?php echo $clientID; ?>";
  15.                 var i=$(this).attr('id');
  16.                 var cell=$("#jan_input_"+i).val();
  17.                 var dataString= 'clientID='+clientID+'&changecell='+i+'&data='+cell;
  18.                 $("#"+i).html('<img src="load.gif" />');
  19.                 $.ajax({
  20.                         type: "POST",
  21.                         url: "ajax_edit.php",
  22.                         data: dataString,
  23.                         cache: false,
  24.                         success: function(html)
  25.                         {
  26.                                 $("#"+i).html(cell);
  27.                         }
  28.                 });
  29.         });
  30.         $(".editbox").mouseup(function()
  31.         {
  32.                 return false
  33.         });
  34.  
  35.         $(document).mouseup(function()
  36.         {
  37.                 $(".editbox").hide();
  38.                 $(".text").show();
  39.         });
  40. });
  41. </script>
  42.  
Jan 2 '12 #1
2 1710
acoder
16,027 Expert Mod 8TB
Could you post a sample of the corresponding HTML code.
Jan 4 '12 #2
Rabbit
12,516 Expert Mod 8TB
It's probably because the code is hiding the edit box.
Jan 4 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Joakim Braun | last post by:
I'm trying to make an "editable table". You double-click on a table cell, it becomes a text input element, you edit the value, click outside the text input and the <td> contents/text node(s) are...
4
by: Silas | last post by:
Hi, I use view to join difference table together for some function. However, when the "real" table fields changed (e.g. add/delete/change field). The view table still use the "old fields". ...
3
by: DStark | last post by:
Hi! Is it possible to iterate through table fields in an ADP? What I'd like to do is: Sub PrintTableFields() Dim dbs As Object Dim tbl As AccessObject Dim fld As ???? Set dbs =...
1
by: dm_dal | last post by:
I'm looking for some feedback or for someone to point me in a good direction. We have a web application that consist of many forms. Some of our clients have asked if we can configure the app in...
1
by: planetthoughtful | last post by:
Hi All, I have a web page that presents records in a table, with one row per record. I'd like to put an edit button next to each record, such that if a user clicks on the edit button next to...
0
by: rdraider | last post by:
I have an audit table that tracks changes to inventory items. I am trying to find the first change in avg_cost per item. The table will contain 1 row for the before record and another row for the...
1
by: sanika1507 | last post by:
If i have a webpage and i have filled the fields ,if all the fields r correctly filled the page is approved and the fields become read only(u cannot edit them )..but I want to revise the page and...
2
by: mp01 | last post by:
Is there a way to create a table that displays tables in order of table with PK first then tables with FK?
1
by: Vicente | last post by:
The form fields are bound correctly to corresponding table fields. This is a simple table with a simple form (3 fields)
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.