The following article will show you how to develop an editing button to open a Bootstrap modal form with the data take from the chosen table row.
This posts is related with sandorBlog(Dynamic Table) to explain how to edit information present on a table using jQuery.
.how to create an edit button
There are many methods to allow the user to edit the information contains the table. In this article I'll explain how to create an editing button like , that can open a Bootstrap Modal Form pre-filled with data. The prefilling action is done using jQuery.
-
<button type="button" class="btn btn-sm btn-primary fas fa-pencil-alt noUnderlineCustom text-white" data-toggle="modal" data-target="#editModal"></button>
This is a HTML code that compose the editing button. -
data-toggle="modal"
This attribute activates the Bootstraps Modal without using JS. -
data-target="#editModal"
This attribute launches a specific Modal looking for its attribute ID.
.editable table example
Please click on the editing button and try to change some data: