function ShowEditBox(serial)
{
$("#divEditBox").slideDown("medium");
var pserial ='PName'+ serial;
var colindex = 0;
var $tr = $("#" + pserial).parent().parent();
$tr.find('td').each(function () {
if (colindex == 2) {
$("#txtName").val($(this).text());
} else if (colindex == 3) {
$("#txtSurName").val($(this).text());
} else if (colindex == 4) {
$("#txtEmail").val($(this).text());
} else if (colindex == 5) {
$("#txtMobile").val($(this).text());
} else if (colindex == 6) {
$("#txtAddress").val($(this).text());
}
colindex++;
})
$("#hdField").val(serial);
}
Whenever i click the edit button in grid view that particular row data should be displayed in text boxes. But here i am getting unnecessary spaces in text boxes. How can i trim the spaces in the Text box(txtName) ?? I am getting spaces in text .