Skip to main content
March 25, 2009
Question

Change focus in a Spry Tabbed panel

  • March 25, 2009
  • 4 replies
  • 6193 views
I have a tabbed panel with three tabs.
email form
client form - default tab
information

Is there a way to change the default tab to the tab that the user clicks on? Or change the default temporarily.

When the email form is submitted the panel gose back to the default panel after the form is submitted. I am trying to get the email tab to stay open so the user can see there confirmation text.

email soatman@comcast.net

Thanks for any help!

Steve



This topic is closed to new replies. Start a new post to keep the conversation going.

4 replies

Inspiring
March 26, 2009
soatman wrote:
> I have a tabbed panel with three tabs.
> email form
> client form - default tab
> information
>
> Is there a way to change the default tab to the tab that the user clicks on?
> Or change the default temporarily.

You can set which tab you want to open by using the defaultTab option in the Spry Tabbed panels. Take a look at the code for the first sample on this page as it defaults to the "Tab 3" tab:
http://labs.adobe.com/technologies/spry/samples/tabbedpanels/tabbed_panel_sample.htm

It creates the tabbed panel with the following code:
var tp1 = new Spry.Widget.TabbedPanels("tp1", { defaultTab: 2 });

For your case, I would suggest using server side code to change the value of the defaultTab, using 0 as the default, and whatever tab number of the one with the server response in it. Remember that Spry uses a 0 based count, as in tab 1 is 0, tab 2 is 1, etc.

FYI: Spry forum is over here:
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid=72&catid=602



--
Danilo Celic
| http://blog.extensioneering.com/
| WebAssist Extensioneer
| Adobe Community Expert
March 26, 2009
Danilo Celic,

Yes thank you. I am able to set the default. my need is.

I have a couple of forms that are in php script the form actions is server_self validation. These are in two of the tabs. When one is submitted the tab panel gose back to the default but I need it to stay on the same tab after the form is submitted and not go to the default tab. Is there a way of not having a default. So even after the form is submitted it stays in that tab? Maybe a way of having the default change to which even tab is pressed.