In Details
i have bind HTML table dynamic i want when user click on td it convert into input textbox and on leave again it convert in td.
<table class="mytbl" id="tblkitledger" cellspacing="0" >
<thead >
<tr>
<th>PART NO</th>
<th>PART NAME</th>
<th class="tblcol3">QTY</th>
<th></th>
</tr>
<tr">
<td>
<input type="text" class="mytxtbox" id="txtpartno" tabindex="3" />
</td>
<td>
<input type="text" class="mytxtbox" id="txtpartname" tabindex="4" />
</td>
<td class="tblcol3">
<input type="text" class="mytxtbox rightpager" id="txtqty" tabindex="5" onblur="AddKitLedger()" onkeypress="return isNumberKey(event)" />
</td>
<td></td>
</tr>
</thead>
<tbody>
</tbody>
</table>
i bind this table using ajax
//Edit Records
function EditRecord(kitid)
{
$("input:text").val("");
$("#tblkitledger tbody").empty();
document.querySelector('#btnsavepopup').innerHTML = "UPDATE";
$.ajax({
type: "POST",
url: "addkit.aspx/getRecords",
data: JSON.stringify({ kitid : kitid }),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response)
{
var rws = "";
var data = JSON.parse(response.d);
$("#hfkid").val(data[0].kid);
$("#txtkitno").val(data[0].kitno);
$("#txtkit").val(data[0].kitname);
for (var i = 0; i <= data.length - 1; i++)
{
rws += "<tr>"
rws += "<td class='notshow'>"+ data[i].klid +"</td>";
rws += "<td>" + data[i].partno + "</td>";
rws += "<td>" + data[i].partname + "</td>";
rws += "<td class='tblrightalign '>" + data[i].qty + "</td>";
rws += "<td><input type='button' name='record' value='X' class='btn-danger' onclick=delerow(this)></td>";
rws += "</tr>";
}
$('#tblkitledger tbody').append(rws);
},
failure: function (response)
{
alert(response.d);
},
complete: function ()
{
$('#fullscreenitem').modal('show');
},
error: function (response) {
alert(response.d);
}
});
}
thank you