Well, I have the following problem:
I have a table with several records, and once a certain link is clicked on the record, a modal window with more information about it is opened.
Link:
<a class="navbar-brand" href="#my_modal" data-toggle="modal" data-book-id="' . $res->codigoLO . '"><i class="fa fa-times"></i></a>
The following script takes a value that is sent per parameter when you click the link and the arrow in an input in the modal window. In fact, I would like that instead of this value be placed in input, be assigned directly to a PHP variable also present in the modal window.
<script type="text/javascript">
$('#my_modal').on('show.bs.modal', function (e) {
var bookId = $(e.relatedTarget).data('book-id');
$(e.currentTarget).find('input[name="bookId"]').val(bookId);
});
</script>
Any ideas how I can do this?