Change currency from dropdown menu - 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: Change currency from dropdown menu (/showthread.php?tid=63429) |
Change currency from dropdown menu - Lykos22 - 10-30-2015 I'd like some help please. I'm having a dropdown menu on the header of every page where I can change the currency set. PHP Code: <select id="set-currency" name="currency" class="form-control"> I have also set a function in MY_Controller for setting the new currency in sessions, so this should apply in every page of my website PHP Code: public function setcurrency() { Finally this is my js script PHP Code: <script type="text/javascript"> How can I set the new currency in session and then refresh the page with the new currency set ? RE: Change currency from dropdown menu - PaulD - 10-30-2015 I am not sure what your problem is with this code as it looks like it should work. Are you getting an error or is the logic not working or is the refresh not reloading with new data? I am not sure if this will help at all, but the location.reload() has an extra parameter, that when set to TRUE reloads the page from the server, otherwise it reloads it from the browser. Quote:location.reload(forceGet) If this has completely misunderstood the problem you are having, I apologise in advance, Best wishes, Paul. |