I have the following list in jsp where I want to just increment the value of the quantity field, without refreshing the page.
The way I did it works, but refresh the page. For what I researched, it would have to be for Ajax.
<table>
<tbody>
<c:forEach items="${revistas}" var="r">
<tr>
<td>${r.nome }</td>
<td>
<form id="testeForm" action="<c:url value="/atualizaQuantidade"/>" method="post" >
<input type="hidden" name="r.cod" id="cod" value="${r.cod}" />
<input type="hidden" name="r.qtd" id="qtd" value="${l.qtd}" />
<button type="submit" class="btn btn-primary">${r.qtd}</button>
</form>
</td>
</tr>
</c:forEach>
</tbody>
</table>
As a list, I have to get the id
of the magazine , the amount in the list and send it to my Java method to increment (that part I know how to do). Now doing this via Ajax, I'm lost. Could you help me?