J'avance à petit pas, mais je retourne sur mon problème d'origine...
Donc, j e clique ici pour ouvrir mon modal 1:
<td><a href="#DetailsFailureCell64" data-toggle="modal" data-book-id="'.$Failure64_Grouped_Row['ANALYSECODE'].'"><i class="fa fa-eye"></i></a></td>
Puis avec javascript:
1 2 3 4 5 6
| <script type="text/javascript">
$('#DetailsFailureCell64').on('show.bs.modal', function(e) {
var bookId = $(e.relatedTarget).data('book-id');
$(e.currentTarget).find('input[name="bookId"]').val(bookId);
});
</script> |
Pour au final afficher mon modal 2:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| <div class="modal" id="DetailsFailureCell64">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title">Failure details for <b><?php echo $LINE;?> Cell64</b></h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<img width="100%" height="15px" src="Bandeau.jpg" border="0" />
<input type="text" name="bookId" value="" /> <--------- ICI JE RECUPERE BIEN LA VALEUR DESIREE
<!-- Modal body -->
<div class="modal-body">
<table class="table table-striped">
<thead>
<tr>
<th>Failure</th>
<th>Type</th>
<th>Logical WPC ID</th>
<th>Date</th>
<th>Lower limit</th>
<th>Value</th>
<th>Upper limit</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<!-- Modal footer -->
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div> |
Ma question est comment la récupérer en PHP dans javascript pour pouvoir effectuer une requête mysql?
Partager