![]() |
Maintaning Jquery Tab State After loading view - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Maintaning Jquery Tab State After loading view (/showthread.php?tid=57645) |
Maintaning Jquery Tab State After loading view - El Forum - 03-30-2013 [eluser]RaGe10940[/eluser] Hi, Me again, and yes its about my emailing subject ![]() I am using Jquery Tabs for different views on my email page... best way for me to ask this question is show a video of the problem : so low and behold : http://www.youtube.com/watch?v=F4elvhznE8E This is my code : Code: if (!$this->email->send()) { Do I have to specifically tell the view which tab to go to? HTML (for the most part) : Code: [removed] Maintaning Jquery Tab State After loading view - El Forum - 03-30-2013 [eluser]TheFuzzy0ne[/eluser] When you submit the form, you should submit it with the URL hash. I couldn't see from the video whether or not it's automatically updated in your address bar when you click on a new tab. If it is (which is a good idea, because people can then bookmark your tabs), then just leave the action attribute empty. If it doesn't, then you need to use Javascript to modify the URL each time a tab is selected, or use redirect() to redirect to the correct URL (complete with URL hash), once the email has been submitted. Redirecting is a good idea, because it prevents forms from being resubmitted when users click the back button. You may also need to add some Javascript that automatically displays the right tab when the page loads, using the URL hash as a reference. Hope that makes sense. Maintaning Jquery Tab State After loading view - El Forum - 03-30-2013 [eluser]RaGe10940[/eluser] Yes I understand where your coming. and no there is no url hash... this seems like its going to be a pain in the butt. How do I add a hash the CI url? Maintaning Jquery Tab State After loading view - El Forum - 03-30-2013 [eluser]TheFuzzy0ne[/eluser] You won't need to if you set it using Javascript. See http://stackoverflow.com/questions/1939041/change-hash-without-reload-in-jquery. From your view, when you open your form, just do this: Code: echo form_open_multipart(); Your form should now submit to whatever's in the address bar, and will include the URL hash when the page reloads, so you can display the correct tab again, (which is also outlined in the stackoverflow page I just linked to). Maintaning Jquery Tab State After loading view - El Forum - 03-30-2013 [eluser]RaGe10940[/eluser] Mkay... I'm getting the hash now in my URL... https://www.finaidtest.com/index.php/email_controller/emailview#student and I also removed all of the echo form_open_multipart(............); leaving me with : echo form_open_multipart(); now I get nothing being send to the controller... This is my jquery : Code: [removed] Maintaning Jquery Tab State After loading view - El Forum - 03-30-2013 [eluser]TheFuzzy0ne[/eluser] Please could you post your entire view, (with the Javascript inline), on http://pastebin.com? I'll be able to set this up and test it on my server. Maintaning Jquery Tab State After loading view - El Forum - 03-30-2013 [eluser]RaGe10940[/eluser] Actually Fuzzy, I abandoned that idea. When it comes down to it, my boss doesn't even know what Jquery UI is or even Jquery for that matter.. I just used links for different pages. as always thanks -> your like my guiding angel ![]() Maintaning Jquery Tab State After loading view - El Forum - 03-30-2013 [eluser]TheFuzzy0ne[/eluser] [quote author="RaGe10940" date="1364659819"]Actually Fuzzy, I abandoned that idea. When it comes down to it, my boss doesn't even know what Jquery UI is or even Jquery for that matter.. I just used links for different pages. [/quote] The simplest solutions are usually the best, and they require less maintenance. I'm sure you could always look into it in the future some time if you ever let your curiosity get the better of you. ![]() I suspect the way you had it originally, wasn't degradable, either -- which is something that could potentially cause headaches for, and angry clients/bosses. [quote author="RaGe10940" date="1364659819"]as always thanks -> your like my guiding angel ![]() More like a mis-guided missile... PoW! Maintaning Jquery Tab State After loading view - El Forum - 03-30-2013 [eluser]RaGe10940[/eluser] Of course. There is no difference in the tab vs. The links just as fast imho and I can customize the links allot easier. Less headaches all around<3 |