1
Good afternoon guys, I have a problem that should be silly, but I’m not able to solve.
I have a list of people... on that list I have a button. When you hover the mouse over the button, the correct person ID appears.
But when I click the button, it opens the modal, and the ID field shows a different number.
<a class="btn btn-warning btn-xs" href="<c:url value="upload?cod=${pessoa.cod}"/>" data-toggle="modal" data-target="#testes">Upload Doc</a>
And here’s my modal:
<div class="modal fade" id="testes" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title">Modal title</h4>
</div>
<div class="modal-body">
<%@include file="formUpload.jsp" %>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
And finally my "form":
<form name="formUpload" id="formUpload" action="<c:url value="/pessoa/uploadDoc"/>" method="post">
<input type="text" name="pessoa.cod" id="pessoaCod" class="id" value="${pessoa.cod}">
I’m confused about this.
This field does not show the correct id.
You can try placing an onclick on the link by calling a javascript function that populates the modal fields at runtime.
– Paulo Weverton
Is Id’s behavior always the same? For example, regardless of the right id, does it always pass id 0 to modal? Or does he behave differently?
– Leonardo Coelho