![]() |
AJAX problem? - refreshed url show post values from AJAX call? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: AJAX problem? - refreshed url show post values from AJAX call? (/showthread.php?tid=1619) |
AJAX problem? - refreshed url show post values from AJAX call? - blackbulldog - 03-26-2015 Hi, I'm using a bootstrap modal form (displayed when user clicks a button) to allow the user to enter some data then submit it via an ajax call to a CI controller. Then I want the CI controller that receives the AJAX request to (for now - still testing) simply refresh the page which allowed the user to fill in the modal form. A strange thing is happening though ... the url for the page BEFORE the user clicks to open the modal form OR clicks to submit the AJAX update looks like this: www.mysite.com/index.php/staff/index after the AJAX call is submitted to the controller the url looks like this: www.mysite.com/index.php/staff/index?addeventstaffdropdown=3&typeid=7&fromDate=2015-09-28&numdays=11¬es=notes anyone know why the post variables from the AJAX call are appearing in the refreshed url? Here's the JQuery code that does the AJAX submit: PHP Code: $('#addeventbutton').click(function () and heres the simple controller to redirect and refresh the 'current' page: PHP Code: public function add_event_ajax() Thanks for looking. RE: AJAX problem? - refreshed url show post values from AJAX call? - mwhitney - 03-26-2015 Have you tried leaving out the second argument in redirect(), or changing it to 'location'? RE: AJAX problem? - refreshed url show post values from AJAX call? - blackbulldog - 03-26-2015 (03-26-2015, 11:08 AM)mwhitney Wrote: Have you tried leaving out the second argument in redirect(), or changing it to 'location'? Yes, tried both but they get the same result. |