I'm assuming you're doing a POST/Redirect/GET for your form submission - as opposed to submitting with AJAX. Since the hash will be removed when you submit to the server, you will need to know which view to return the user to based on some other method. There are a few options for you:
You could have different forms for each tab that POST to a distinct URL (/path/to/submit/1, /path/to/submit/2...). Then, depending on which URL you POST to, you can redirect to the user to the appropriate URL with the appropriate hash fragment set. Or, you could send a parameter in your POST that includes the URL hash fragment that you want to redirect back to. Lastly, you could just use AJAX to POST your form. That would be my personal recommendation. -Vincent On Tue, Mar 4, 2014 at 10:27 AM, Jonathan Vanasco <[email protected]>wrote: > thanks for the fast reply. i've experimented with that on a few views > before, but never for a form submission. > > do you POST into "/path/to/submit#pane" ? > > > On Tuesday, March 4, 2014 12:09:09 PM UTC-5, Vincent Catalano wrote: >> >> When dealing with bootstrap's tabs I prefer to handle which tabs should >> be displayed on the front-end using only JS and the URL hash fragment. That >> way, the only thing that manages the "state" of the view is the URL. >> >> Basically, I have some JS that listens for changes to the hash fragment >> and displays the appropriate tab based on the hash fragment's value - much >> like a simple JS router. Based on the value of your hash you should then be >> able to determine which tab/pane is currently active. When the page loads I >> just make sure I call the same method as the hash change event so that the >> appropriate tab content is displayed by default. >> >> -Vincent >> > -- > You received this message because you are subscribed to the Google Groups > "pylons-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/pylons-discuss. > For more options, visit https://groups.google.com/groups/opt_out. > -- Vincent Catalano Software Engineer and Web Ninja, (520).603.8944 -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/pylons-discuss. For more options, visit https://groups.google.com/groups/opt_out.
