CodeIgniter - showing Bootstrap modal after form post

I have a CodeIgniter application using Bootstrap. In the application I have a data entry form, which when submitted posts the data to a database table. When the controller has received validated data from the form (view), it pops the data into an array and passes it to the Model to post to the database. The Model returns a success or failure error code back to the Controller.

I would then like to display a Bootstrap Modal Dialog over the (now completed) from display, with a 'data posted successfully' message.

<?php public function show_form() { $this->load->library('form_validation'); $this->form_validation->set_rules(...); if ($this->form_validation->run() == FALSE) { //load the header, body and footer view(s)} else { // the data has passed validation. $this->load->model('data_model'); // set $form_fields[] to hold the form data $result = $this->data_model->post_form_data($form_fields); if ($result == 0) { // Display A Bootstrap Modal saying that the data was posted }

Is there are way of calling and displaying a Bootstrap Modal over my completed form?

Category:php Views:1 Time:2017-09-12

Related post

Copyright (C), All Rights Reserved.

processed in 0.114 (s). 10 q(s)