Codeigniter - Show Information in Modal Window

Codeigniter - Show Information in Modal Window

I answered myself this question.

<td data-title="Edit" align="center"><a href="<?php echo base_url("customer_edit/edit/$customer->cusId"); ?>"><button class="btn btn-primary btn-xs"><i class="fa fa-pencil"></i></button></a> <a data-toggle="modal" href="#<?php  echo $customer->cusId; ?>"><button class="btn btn-primary btn-xs"><i class="fa fa-eye"></i></button></a></td>

I edit a href like that href="#<?php echo $customer->cusId; ?>
Afterthat I just write this code on modal top:

<?php foreach ($customers as $get) { ?>
<div class="modal fade" id="<?php echo $get->cusId; ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<?php } ?>

I edit id like that id="#<?php echo $get->cusId; ?>

It works better now!

view full data in modal by particular id in codeigniter using ajax

var id = $(this).attr("id");
<script src=""></script>

<button class="btn btn-primary view_data" id="1" >VIEW FULL INFO</button>

How to show a popup modal in codeIgniter?

You are including jQuery more than once, you have actually included jQuery in your head section, remove those two before your custom javascript, that's why you are getting $(...).modal is not a function error:

<script src="" type="text/javascript"></script>
<script src=""></script>

Related Topics

Leave a reply