The value is sent from a page to a modal of Bootstrap in the following way by means of the data-book-id=""
of the label <a></a>
.
<?php while($row = mysql_fetch_array($sql)){
echo " <tr>";
echo " "?><td style="display:none;"><?php
echo $row['SecCarro']."</td>";
echo " <td>".$row['CorreoCliente']."</td>";
echo " <td><a rel=\"tooltip\"title=\"Ver\" href=\"sys/detalleped.php\" data-toggle=\"modal\" data-target=\"#proModal\" data-book-id=\"".$row['SecCarro']."\" > <i class=\"fa fa-eye fa-lg\" ></i></a></td>";
echo " </tr>"; }?>
I capture it in the following way.
<script>
$('#proModal').on('show.bs.modal', function(e) {
var bookId = $(e.relatedTarget).data('book-id');
$(e.currentTarget).find('input[name="bookId"]').val(bookId);
});</script>
<input type="text" name="bookId" id="bookId" value=""/>
<?php
$var =?? // Aqui necesito el valor del input... :/
?>
And here is where I stayed, I would appreciate any help possible.