# Please how do i make my update code in js.bootgrid table

**URL:** <https://forum.freecodecamp.org/t/please-how-do-i-make-my-update-code-in-js-bootgrid-table/139145>\
**Category:** General\
**Created:** [July 30, 2017, 10:25pm UTC](https://forum.freecodecamp.org/t/please-how-do-i-make-my-update-code-in-js-bootgrid-table/139145 "2017-07-30T22:25:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ELMARSHALLFAB](https://avatars.discourse-cdn.com/v4/letter/e/c57346/32.png) [@ELMARSHALLFAB](https://forum.freecodecamp.org/u/ELMARSHALLFAB)\
**Post date:** [July 30, 2017, 10:25pm UTC](https://forum.freecodecamp.org/t/please-how-do-i-make-my-update-code-in-js-bootgrid-table/139145/1 "2017-07-30T22:25:50Z")

</div>

```auto
$(document).on("loaded.rs.jquery.bootgrid", function()
 {
  productTable.find(".update").on("click", function(event)
  {
   var product_id = $(this).data("row-id");
    $.ajax({
    url:"fetch_single.php",
    method:"POST",
    data:{product_id:product_id},
    dataType:"json",
    success:function(data)
    {
     $('#productModal').modal('show');
     $('#category_id').val(data.category_id);
     $('#product_name').val(data.product_name);
     $('#product_qty').val(data.product_qty);
     $('#product_price').val(data.product_price);
     $('.modal-title').text("Edit Product");
     $('#product_id').val(product_id);
     $('#action').val("Edit");
     $('#operation').val("Edit");
    }
   });
  });
 });

```

---

<div class="post-metadata">

**Author:** ![PortableStick](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/portablestick/32/65591_2.png) [@PortableStick](https://forum.freecodecamp.org/u/PortableStick)\
**Post date:** [July 30, 2017, 10:49pm UTC](https://forum.freecodecamp.org/t/please-how-do-i-make-my-update-code-in-js-bootgrid-table/139145/2 "2017-07-30T22:49:57Z")

</div>

1. Is this project on CodePen? Could you link to that instead?
2. What is it that you’re trying to do?
3. What is happening?
4. What do you think should be happening?

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 17, 2021, 8:47pm UTC](https://forum.freecodecamp.org/t/please-how-do-i-make-my-update-code-in-js-bootgrid-table/139145/3 "2021-01-17T20:47:05Z")

</div>

Closed on January 17, 2021, 8:47pm UTC


