0

Hi , I have table created by Json :

function show(json)
{
var content = '<tbody>';
var counter;
for(counter = 0; counter < json.length; counter++)
{
content += '<tr><td>' + 
                 json[counter]['id'] + '</td>' + '<td>' + json[counter]['time'] + '<td>' + json[counter]['fullname'] + '</td>' + '<td>' + json[counter]['message'] +'</td>' +'<td>' + json[counter]['level'] +'</td>' +
                 '<td><div id = ' + json[counter]['id'] + '><input type="button" id = "listbutton" value="Answer" onclick="edit(' + json[counter]['id'] + ')" ></td>' +
                 '</td></tr>';
}
//alert(counter);
content += '</tbody></table>';

$('#myTable').append(content);
}

I want to edit a specific cell of this table after sending a message. This message is sent like this : I click an "Answer" button on a list and a message box appears related to this table row.
What I want to do is, when the user sends message, the button disappears on the table and the message appears instead of the button. Can I do it here? :

replymessage = "reply=" + reply + "&id=" + $("#currentUserId").val();
$.ajax({
type : 'POST',
url : 'reply.php',
data : replymessage,
success : function (msg)
{
if(msg == '1')
{
//do the thing here!
}
else
alert("A problem occured, contact system admin.");
}
});

Thank you

2
Contributors
1
Reply
4
Views
4 Years
Discussion Span
Last Post by radhakrishna.p
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.