Skip to content Skip to sidebar Skip to footer

Fill Form Using Table Data

So I have a form through which I add entries to my database, I am trying to use the same form to update/edit existing records in the database. My page consists of a form to add dat

Solution 1:

$("#tableID").on("click", ".edit_button", function() {
    var data = $(this).closest("td").siblings().map(function() {
        return $(this).text();
    }).toArray();

    console.log(data);
});

Use like this may be it is helpful

$("#tableID").click( function() {
    var data = $(this).closest("td").siblings().map(function() {
        return $(this).text();
    }).toArray();

    console.log(data);
});

Post a Comment for "Fill Form Using Table Data"