Надеюсь, кто-нибудь может мне помочь. У меня есть таблица с выражением while для моих данных. Теперь я хочу, чтобы данные для каждой строки отображались в модальном окне.PHP и Bootstrap Модальные переменные
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th>ID</th>
<th>Marke</th>
<th>Modell</th>
<th>Baujahr</th>
<th>Aktion</th>
</tr>
</thead>
<tbody>';
// Holen des Ergebis in die Variable $erg
while($erg_motor = mysqli_fetch_assoc($db_erg_motor))
#print_r($erg_motor);
{
$body.='
<tr>
<td>'.$erg_motor['id'].'</td>
<td><input name="motor_fabrikat" value="'.$erg_motor['motor_fabrikat'].'"></td>
<td><input name="motor_modell" value="'.$erg_motor['motor_modell'].'"></td>
<td><input name="motor_ez" value="'.$erg_motor['motor_ez'].'"></td>
<td><button class="btn btn-primary" data-toggle="modal" data-target="#myModal">Edit</span></button></td>
</tr>
';
}
$body.='
</tbody>
<tfoot>
<tr>
<th>ID</th>
<th>Marke</th>
<th>Modell</th>
<th>Baujahr</th>
<th>Aktion</th>
</tr>
</tfoot>
и код для моего модального окна
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">×</span>
<span class="sr-only">Close</span>
</button>
<h4 class="modal-title" id="myModalLabel">Interne Vorgangsnummer: </h4>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary">Speichern</button>
</div>
</div>
</div>
</div>
и теперь я хочу, чтобы отобразить в модальном теле моего уникального ключом $erg_motor['id']
. Позже я хочу сделать обновление данных, содержащих $erg_motor['id']
.
Рассмотренный делать это динамически? http://stackoverflow.com/questions/15130419/loading-dynamic-content-in-jquery-dialog – AshHimself