javascript - Bootstrap Modal from PHP generated table list - Pass in values from list -
i have simple html table generated php call database:
<?php foreach($records $record){ $staffname = $availability->getfield('fullname') ; $staffmobile = $availability->getfield('cell') ; }
i display table link on name bootstrap modal:
<tr> <td><a href="#" data-toggle="modal" data-target="#mymodal"><?php echo $staffname; ?></td> <td><?php echo $staffmobile ;?>mobile number</td> </tr>
i modal appears have button able call , sms staff member in list. modal @ moment appears:
<div class="modal" id="mymodal"> <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">contact staff</h4> </div> <div class="modal-body"> <button type="button" class="btn btn-default" data-dismiss="modal">call</button> <button type="button" class="btn btn-default" data-dismiss="modal">sms</button> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">cancel</button> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal -->
i call , sms buttons reference using format:
tel:<?php echo $staffmobile ;?> sms:<?php echo $staffmobile ;?>
but can't work out way link each individual $staffmobile value modal has 1 instance.
have been struggling few hours , not making progress - not sure if possible
Comments
Post a Comment