You must Sign In to post a response.
  • Category: JQuery

    How to set value to texbox inside html table

    Hi all,

    in my application, i want to set the value of textbox inside html table.

    following is my code

    var m = 1;
    for (m; m <= cnt; m++) {
    $("#grdtable").find("tr").eq(m).find("td").eq(1).text(data.d[m - 1].Vlnaccount);
    //$("#grdtable").find("tr").eq(m).find("td").eq(1).$('input[type = text]').val(data.d[m - 1].Vlnaccount);
    }

    the above working but it is not setting the value to textbox.,but it set the value to td.and textbox is not showing.

    my requirement is to set value inside textbox .

    how to solve it.

    Regards

    Baiju
  • #759692
    Hello Baiju,

    You can do it by below Java Script code easily :
    $(table.rows.item(i).cells[5])).find('input').val("45");

    Hope this will help you.

    Regards,
    Nirav Lalan
    DNS Gold Member
    "If you can dream it, you can do it."

  • #759698
    Hi,

    u can use the below code to set the value in Jquerry :

    for (var i = 0; i < tableRowCount; i++) {
    var rowDisAmt = $(table.rows.item(i + 1).cells[4]).find('input').val();
    }

    Hope it will helpful for uuu..

    thanks,
    Chitaranjan


  • Sign In to post your comments