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

  • Retain JQuery UI tab selection even after form post 2011-02-15

    I'm using JQuery UI tabs where I have several forms within tabs. What I want is to Retain Tab Selection even after Form Post. I don't want to use cookie.js You can see my code here at jsbin How can I achieve this using other way? Thanks -------------

  • why does this crazy site not show my question after i post it sometimes? 2012-12-23

    why does this crazy site not show my question after i post it sumtimes , cant see if i get a reply if i cant go to the question i asked , its just not there sometimes , yesterday I had to ask same question twice before it showed up again? -----------

  • Jquery show div after form post 2011-03-10

    I have a link on a page that toggles the visibility of a div. The div contains filter options for a form, which is posted. I would like to retain the filter visibility after a post; so if its open before post, it remains open after post. Here is my s

  • How to Keep the selected value of the select box after Form POST or GET 2010-05-25

    Im trying to implement the search feature in my website. when the search keyword is entered in the textbox, and the category combo is selected, the form will be Posted and the result will be shown on the same page. what i want is to keep the selected

  • Unable to display twitter bootstrap modal after ajax request 2011-12-12

    I want to show modal window on click of link but also want to do ajax request to get the object which needs to be shown on modal window. I am getting response with the content which needs to be shown on modal window but it is not popping up as modal

  • AngularJS: Modify Bootstrap Modal after loading content 2014-08-12

    I want to use this pretty image cropper in my AngularJS project. When I use it the "normal" way, that is on a plain page, everything works fine. The problem is that I want to put it on to the Bootstrap modal dialog. In order to initialize the cropper

  • Getting display after form post submission in Google App Engine in Python 2011-03-21

    Content of page not displayed after a form post, but displayed when directly viewing the page. I have a Python App Engine piece of code that is attempting to direct to a new page and display a programatically defined (i.e. in the code, not html) piec

  • django, return to previous page after form POST submit 2012-02-15

    In my web page I have a form that is being filled with data after some ajax requests. For example when a user chooses an item from the list, a simple ajax request is sent to the database that the item has been selected (but not confirmed, yet). Then

  • Show html content after form send 2014-09-30

    I'm sorry, I know php so bad. I have php script which sends my form to my email address. <?php class Sendform { private static $from_name = ''; private static $from_email = '[email protected]'; private static $to_email = '[email protected]

  • How can I prevent the focus on the toggle button for a Bootstrap modal after the modal closes? 2015-02-09

    I have a button that toggles a Bootstrap modal. The button itself is wrapped in a div so a tooltip shows up on hover. When I close the modal, the button gets focused and the tooltip shows without hovering the element. <span data-toggle="tooltip" d

  • php, echo doesn't show after form post? 2011-09-05

    i have a form and when i post it i create a cookie, then i read the cookie and if isset then do something: inside read.php <?php if (isset($_COOKIE['voteforme'])) { echo 'You voted this profile'; } else {?> <form method="post" action="<?p

  • Showing jQueryUI Modal After Postback 2011-07-16

    I have an ASP.NET page with a simple form and a submit button. Upon submission, I am displaying results on an AJAX UpdatePanel, which works just as desired. However, now I would like to use jQuery UI to display these results on a modal window instead

  • Ajax calls do not work after form post on webkit 2011-12-01

    This is a continuation of this question, which turned not into an question after a while: Jquery $.get does not work in chrome: Basically after submitting a form on my browser, I display a progress bar dialogue on my page while the request is process

  • Jquery modal for form posting 2010-09-20

    Greetings I would like to use a jquery based modal library for dynamicly generating ajax based and forms as a modal to display and submit. I already use jquery ui for other purposes however I am not sure if jquery ui dialog is a good way of displayin

  • Close Browser Window after Form Post 2008-10-07

    Here's my situation. I have a button on my ASP.NET webform. This button creates a new browser window pointing to a page which has a lot of hidden fields (which are dynamically generated). This form submits itself to SQL Reporting Services on the bodi

  • Using jQuery mobile to update DOM after form POST 2011-05-29

    jQuery Mobile's form submission is handled automatically with AJAX. However it isn't clear how to handle the Response. I want to update the page with some JSON coming back from the server. Do I need to disable jQuery Mobile's form AJAX? -------------

  • open new TCPDF after form post 2012-04-10

    I have a form, test.html, (create in JS using dhtmlx, unimportant) that I want to submit to a PHP script, generateReport.php generateReport.php creates a PDF using the information posted from the test.html using the TCPDF libraries. How can I post th

  • How to maintain the state of a mvc checkboxlist after form post? 2010-08-30

    I am using a checkboxlist helper and dynamically binding it..Now i want to maintain the state of checkboxes? public ActionResult Step3() { CustomerQuestion _Cust = new CustomerQuestion(); //Retrieve the answer from database by siteid var Questions =

  • Execute code after 2011-12-14

    Is there anyway to execute code after Form.Show()? What I am doing is a small menu that will popup after user clicks the mouse right click and if I use Form.ShowDialog() I can't click anywhere but on that menu and it should be that if I clicked anywh

  • checkbox checked with php form post? 2010-05-08

    how do I check a checkbox? I've tried 1, On, Yes that doesn't work. putting the worked "checked" alone works but then how do I check with php after form post of the checkbox is checked? <input type="checkbox" class="inputcheckbox" id="newmsg" name

  • Cant get Bootstrap modal.js to work 2011-11-28

    EDIT: Keep in mind this answer was asked before Bootstrap 2 came out and therefore is relative to the first release I am trying to dynamically add and show Bootstrap modal windows with AJAX content, but after looking at the documentation for a good h

  • Saving checkbox state on form post problem 2011-06-30

    I'm having problems setting the unchecked state of checkboxes upon form post. I have over 1000 checkboxes and so far i am able to check each checkbox n save there checked state. My problem however is unchecking the checkboxes. I'm not having problems

  • twitter Bootstrap modal form validation error in codeigniter 2013-02-09

    I am trying to validate the form in loaded in twitter bootstrap modal , it is working fine upto validating and once I click save changes, it is navigating to the save function with the following message {"success":true,"message":"ok"} I am trying to

  • bootstrap modal disappear immediately after showing 2012-03-27

    I'm using bootstrap's modal plugin in rails The website says I can gain the function without write javascript. I add the following line in my HTML(in slim): div#makeDream.modal.hide.fade div.modal-header a.close data-dismiss='modal' h3 Hello World! d

Copyright (C), All Rights Reserved.

processed in 0.162 (s). 11 q(s)