5
I have the following button:
echo '<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-cliente='.$r->idCliente.' data-datainicial='.$_GET['data_inicial'].' data-datafinal='.$_GET['data_final'].' data-target="#myModal">Boleto</button>';
I would like to recover data-cliente, data-datainicial, data-datafinal
and places it within the modal div
:
<div...>
<div class="modal-footer">
<a href="teste/cliente/datainicial/datafinal"><button type="button" class="btn btn-danger" data-dismiss="modal">Gerar PDF</button></a> <---- Aqui preciso recuperar estas 3 variaveis.
<a href="teste/cliente/datainicial/datafinal"><button type="button" class="btn btn-primary" data-dismiss="modal">Enviar E-Mail</button></a> <---- Aqui preciso recuperar estas 3 variaveis.
</div>
</div>
How can I recover this data?
But then how I recover the variables inside the modal?
– Sr. André Baill
@Andrébaill depends a little on what you want to do. If you explain better how you need these data I can adapt. The answer as it stands is what’s in the fields
data-
to new fieldsdata-
in the HTML where you said you needed it.– Sergio