auto go back? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: auto go back? (/showthread.php?tid=36338) |
auto go back? - El Forum - 11-28-2010 [eluser]Jumps Like A Black Guy[/eluser] I dont know if this is possible. I want to know if I can set an auto go back, for different instances? This is what I mean... The way the success/error messages display on my site are like this Code: <h2><?php echo $this->lang->line('Message_Display');?></h2> If you noticed in the code above they put <!-- --> around the go back button. I tried it because I was wondering why they wern't using it. I found out it doesn't work in a lot of ways. For instance, when a user logs out a success message shows with the go back button which is a bad idea. Or when a user is logged in and say they just edited there profile, a success message shows up with the back button which is only useful if the user messed up. Long story short I want to set auto go backs with javascript... Im guessing this can be done with else statments, but im not sure. When a user is not logged in I dont mind the back button, but I'd like it if when a user is logged in, and say they edit there profile, etc. When they see the success/error message I'd like to auto go back to member account home page, etc. I know this is long, but im trying to explain what im thinking at the moment the best i can. auto go back? - El Forum - 11-29-2010 [eluser]Jumps Like A Black Guy[/eluser] So! No one knows? I'll keep looking to see if I can find an answer. auto go back? - El Forum - 11-30-2010 [eluser]teampoop[/eluser] So there are certain situations, or controls, that exist where you do not want the view to display the 'goback' functionality? I would recommend setting a key in your $data that you test again. If that key !exists, show button or script block, else don't... I've done auto backs before and what I do is set a function in my main js, call it goback(), that has a settimeout and then does the history.go(-1) inside. Then just create your block that exists only if !$data[dontgoback]. js: Code: function goback() { view: Code: <h2><?php echo $this->lang->line('Message_Display');?></h2> hth |