sql >> Base de Datos >  >> RDS >> Mysql

Modal no se carga usando javascript en php (CodeIgniter)

Pruebe el siguiente código; esto funcionará

public function insert($data) {
    // Inserting into your table
    // Calling model
    $done = $this->db->insert('sign_up', $data);

    // You can do something else here
    if($done) {
?>
        <script>$(document).ready(function(){$('#thankyouModal').modal('show')});</script>
        <div class="modal fade" id="thankyouModal" tabindex="-1" role="dialog">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="myModalLabel">Thank you for pre-registering!</h4>
                </div>
                <div class="modal-body">
                    <p>Thanks for getting in touch!</p>                     
                </div>    
            </div>
        </div>
    </div>
<?php
    }
}