Well, I have a table in which there is a checkbox component. This component has the task of enabling and disabling a target on my website. The figure below shows a table row with that element:
Hereisthehtmlcode,itdoesthecheckonlyifitiscomingtrueorfalsefromthedatabasetorenderonthescreen:
<c:forEachitems="${destination}" var="d">
<tr>
<td>${d.dtName}</td>
<td>${d.categories.ctName}</td>
<td>
<div class="make-switch" data-on="primary" data-off="info">
<c:choose>
<c:when test="${d.dtAppearWebsite}">
<input type="checkbox" checked>
</c:when>
<c:otherwise>
<input type="checkbox">
</c:otherwise>
</c:choose>
</div>
</td>
</tr>
</c:forEach>
Well, my question is how could I change the state of my component via AJAX and reflect on the database. The biggest question is how do I get that component and make the change asynchronously.
Has anyone ever done anything like this and can you give me some strength?
Thanks for everyone's attention