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.
Code:
<script type="text/javascript" src="http://ajax.googleapis.com/
ajax/libs/jquery/1.5/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
$(".edit_td").click(function()
{
var i=$(this).attr('id');
$("#jan_"+i).hide();
$("#jan_input_"+i).show();
}).change(function()
{
var clientID="<?php echo $clientID; ?>";
var i=$(this).attr('id');
var cell=$("#jan_input_"+i).val();
var dataString= 'clientID='+clientID+'&changecell='+i+'&data='+cell;
$("#"+i).html('<img src="load.gif" />');
$.ajax({
type: "POST",
url: "ajax_edit.php",
data: dataString,
cache: false,
success: function(html)
{
$("#"+i).html(cell);
}
});
});
$(".editbox").mouseup(function()
{
return false
});
$(document).mouseup(function()
{
$(".editbox").hide();
$(".text").show();
});
});
</script>
Comment