Bootstrap model displays first rows data only and off centered

Tuesday, July 8, 2014










Take the 2-minute tour ×

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.


















I have set up a table and the first row is a button to a bootstrap modal. The link attached to it seems to work correctly but when you select the button the modal display only partially on screen and always displays the first rows data even when selecting other rows in the table.


Link to page Using bootstrap 3.0.0 jquery 1.11.1


Php script



<!-- Button HTML (to Trigger Modal) -->

<a href="../Dispatch/scripts/dispatch.php?id=<?php echo $fetchpending['id'];?>" role="button" class="btn btn-large btn-primary" data-toggle="modal" data-target="#myModal">Dispatch</a>



<!-- Modal HTML -->

<div id="myModal" class="modal fade">

<div class="modal-dialog">

<div class="modal-content">

<!-- Content will be loaded here from "remote.php" file -->

</div>

</div>

</div>


Forms Page



<?php
$id= $_GET['id'];
date_default_timezone_set('America/Detroit');

$pending= "SELECT * FROM incidents WHERE id = $id";
$resultpending = mysql_query($pending);
$fetchpending= mysql_fetch_assoc($resultpending);
$incidentid=$fetchpending['id'];
?>

<div class="modal-header">
<a class="close" data-dismiss="modal">×</a>
<h3>Incident # <?php echo $fetchpending['incident_id'];?></h3>
</div>
<div>
<form class="Dispatch">
<fieldset>
<div class="modal-body">
<ul class="nav nav-list">
<div class="available_units">
<li class="nav-header">Unit</li>
<li><div class="col-md-8">
<button id="button1id" name="button1id" class="btn btn-success">BLS 2</button>
<button id="button2id" name="button2id" class="btn btn-danger">Medic 4</button>
<button id="button2id" name="button2id" class="btn btn-danger">Medic 1</button>
<button id="button2id" name="button2id" class="btn btn-danger">Medic 5</button>
<button id="button1id" name="button1id" class="btn btn-success">BLS 2</button>
<button id="button2id" name="button2id" class="btn btn-danger">Medic 6</button>
<button id="button2id" name="button2id" class="btn btn-success">BLS 10</button>
<button id="button2id" name="button2id" class="btn btn-success">BLS 50</button>
</div></li>
</div>
<div class="type">
<li class="nav-header">Incident Type</li>
<li>
<?php
$intype= $fetchpending['incident_type'];
$type= "SELECT * FROM incident_types
WHERE id=$intype";
$resulttype = mysql_query($type);
$fetchtype= mysql_fetch_assoc($resulttype);
echo $fetchtype['name'];?>
</li>
</div>
<div class="address">
<li class="nav-header">Address</li>
<li><?php echo $fetchpending['pu_address'];?></li>
</div>
<div class="city">
<li class="nav-header">City</li>
<li><?php echo $fetchpending['pu_city'];?></li>
</div>
<div class="notes">
<li class="nav-header">Notes</li>
<li><?php echo $fetchpending['notes'];?>
</li>
</div>
</ul>
</div>
</fieldset>
</form>
</div>
<div class="modal-footer">
<button class="btn btn-success" id="submit">submit</button>
<a href="http://ift.tt/Wao6TO" class="btn" data-dismiss="modal">Close</a>
</div>















lang-php









http://ift.tt/1ssSg6E