2

We have a page with three Web Forms For Marketers forms that are on three separate DHTML tabs. If a user fills out and submits the form, they end up back on the default tab, and their thank message is on the tab of the form they filled out.

We looked into possibly using hastags to indicate which tab you are on so we can set the proper focus when the page loads after the WFFM Form postsback, but hashtags are stripped off the URL during the postback. Query string parameters do seem to survive the postback, but having the tab navigation set these would incur a post back themselves, eliminating the advantage of using DHTML tabs.

Does anyone have a good solution for handling displaying the correct tab after the postback?

Sitecore Version: 6.4.1 (rev. 110324) Web Forms for Marketers-2.2.0 (rev. 110303)

4

3 回答 3

2

对于另一种方法,您可以使用 javascript 来更新选项卡更改时的 cookie 吃时间。下次加载页面时,会检查 cookie 以找出用户上一个选项卡,并将该​​选项卡恢复为默认选项卡(此时它也可以清除 cookie)。

于 2011-10-04T16:13:15.407 回答
1

您可以为此使用 cookie。

  1. 选择选项卡时,使用所选索引的值存储 cookie(如有必要,使用唯一名称,用于当前路径等)。
  2. 在页面准备就绪时,检查您的 cookie。如果存在,请获取该值,并将相应的选项卡设置为选中状态。

是的,它是一个 cookie,可能不是 100% 理想,但我认为在这种情况下它很好,因为这只是 UI 糖。

哎呀,jQuery UI 选项卡甚至内置了这个:http: //jqueryui.com/demos/tabs/#option-cookie

于 2011-10-04T16:18:27.337 回答
0

覆盖提交表单的控件的行为,并在该回发中让它向页面发出一些 javascript,以设置当前选项卡的值。您可以在页面上使用您的 javascript 来使用变量来设置默认选项卡以显示。

于 2011-10-04T15:16:40.990 回答