I'm trying to bring a value that when clicking a button brings an input it works but the value does not appear inside the Value of the input so I can not capture this value via PHP. >
Follow the code
Button
<a href="#my_modal" data-toggle="modal" data-fornecedor-id="<?php echo $rowPedido->id; ?>"><img src="img/lupa.png" ></a>
Input
<input type="text" name="idPedido" id="idPedido" value="" />
JS
$('#my_modal').on('show.bs.modal', function(e) {
var idPedido = $(e.relatedTarget).data('fornecedor-id');
document.getElementById('idPedido').value = idPedido;
});